From 11c946229c51e98d26b8a25fd592f190f098764b Mon Sep 17 00:00:00 2001 From: Dmitry Eremin Date: Thu, 20 Feb 2014 12:39:30 +0400 Subject: [PATCH] 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 --- lustre/ldlm/ldlm_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) == -- 1.8.3.1