Whamcloud - gitweb
LU-4629 ldlm: fix NULL pointer dereference 23/9323/4
authorDmitry Eremin <dmitry.eremin@intel.com>
Thu, 20 Feb 2014 08:39:30 +0000 (12:39 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 25 Mar 2014 18:48:40 +0000 (18:48 +0000)
Pointer '*exp' returned from call to function 'class_conn2export'
at line 523 may be NULL and may be dereferenced at line 543.

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

index b4c24fc..5006484 100644 (file)
@@ -540,7 +540,7 @@ int client_connect_import(const struct lu_env *env,
                 LASSERT (imp->imp_state == LUSTRE_IMP_DISCON);
                 GOTO(out_ldlm, rc);
         }
-        LASSERT((*exp)->exp_connection);
+       LASSERT(*exp != NULL && (*exp)->exp_connection);
 
         if (data) {
                 LASSERTF((ocd->ocd_connect_flags & data->ocd_connect_flags) ==