Whamcloud - gitweb
LU-6517 lmv: fix potential null pointer dereference 05/14605/3
authorOleg Drokin <oleg.drokin@intel.com>
Mon, 18 May 2015 15:31:33 +0000 (11:31 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 25 May 2015 03:06:13 +0000 (03:06 +0000)
In lmv_disconnect_mdc do procfs removal only if we actually know the name.

Change-Id: Icb658a8a2007eea254ea5ce70b95c5d73df89914
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/14605
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/lmv/lmv_obd.c

index 5fe258e..5f16b32 100644 (file)
@@ -610,11 +610,11 @@ static int lmv_disconnect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
                 mdc_obd->obd_force = obd->obd_force;
                 mdc_obd->obd_fail = obd->obd_fail;
                 mdc_obd->obd_no_recov = obd->obd_no_recov;
                 mdc_obd->obd_force = obd->obd_force;
                 mdc_obd->obd_fail = obd->obd_fail;
                 mdc_obd->obd_no_recov = obd->obd_no_recov;
-        }
 
 
-       if (lmv->targets_proc_entry != NULL)
-               lprocfs_remove_proc_entry(mdc_obd->obd_name,
-                                         lmv->targets_proc_entry);
+               if (lmv->targets_proc_entry != NULL)
+                       lprocfs_remove_proc_entry(mdc_obd->obd_name,
+                                                 lmv->targets_proc_entry);
+       }
 
        rc = obd_fid_fini(tgt->ltd_exp->exp_obd);
        if (rc)
 
        rc = obd_fid_fini(tgt->ltd_exp->exp_obd);
        if (rc)