Whamcloud - gitweb
LU-5654 osp: Call obd_fid_fini() on osp_init0() error path 37/12037/2
authorLi Wei <wei.g.li@intel.com>
Wed, 24 Sep 2014 09:09:48 +0000 (17:09 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 11 Nov 2014 17:18:30 +0000 (17:18 +0000)
osp_init0() should call obd_fid_fini() on its error path to avoid
leaks.

Change-Id: I1a679db172ae60c74049d2dd3e111c93cfcbeda2
Signed-off-by: Li Wei <wei.g.li@intel.com>
Reviewed-on: http://review.whamcloud.com/12037
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
lustre/osp/osp_dev.c

index 41c7513..61e697f 100644 (file)
@@ -1021,7 +1021,7 @@ static int osp_init0(const struct lu_env *env, struct osp_device *osp,
                 * used in orphan cleanup. */
                rc = osp_last_used_init(env, osp);
                if (rc)
-                       GOTO(out_proc, rc);
+                       GOTO(out_fid, rc);
 
 
                /* Initialize precreation thread, it handles new
@@ -1065,6 +1065,8 @@ out_precreat:
 out_last_used:
        if (!osp->opd_connect_mdt)
                osp_last_used_fini(env, osp);
+out_fid:
+       obd_fid_fini(osp->opd_obd);
 out_proc:
        ptlrpc_lprocfs_unregister_obd(obd);
        lprocfs_obd_cleanup(obd);