From: Dmitry Eremin Date: Thu, 20 Feb 2014 08:39:30 +0000 (+0400) Subject: LU-4629 ldlm: fix NULL pointer dereference X-Git-Tag: 2.5.58~68 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F23%2F9323%2F4;p=fs%2Flustre-release.git LU-4629 ldlm: fix NULL pointer dereference 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 Change-Id: I084ae2ae76861aef4fd93477551bc9d0dd5f4478 Reviewed-on: http://review.whamcloud.com/9323 Tested-by: Jenkins Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index b4c24fc..5006484 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -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) ==