From a425bb2e0f924912be01a003b978a6bcfb931a69 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 25 Feb 2009 19:50:44 +0000 Subject: [PATCH] - finish device in error path --- lustre/obdclass/obd_mount.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index a390214..2516be56 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -1423,7 +1423,7 @@ static struct lu_device *try_start_osd(struct lustre_mount_data *lmd, unsigned long s_flags) { struct obd_type *type = NULL; - struct lu_device_type *ldt; + struct lu_device_type *ldt = NULL; struct lu_device *d = NULL; struct dt_device *dt; struct lu_env env; @@ -1479,8 +1479,11 @@ out_type: out_alloc: out: if (rc) { - if (d) + if (d) { + LASSERT(ldt); + ldt->ldt_ops->ldto_device_fini(&env, d); ldt->ldt_ops->ldto_device_free(&env, d); + } if (type) class_put_type(type); d = ERR_PTR(rc); -- 1.8.3.1