From: Dmitry Eremin Date: Sun, 27 Apr 2014 17:06:52 +0000 (-0400) Subject: staging/lustre/ldlm: fix NULL pointer dereference X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f85065e534fe8ba6de9b3443c4beacbc3a6ec32d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging/lustre/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 Reviewed-on: http://review.whamcloud.com/9323 ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629 Reviewed-by: John L. Hammond Reviewed-by: James Simmons Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c index 1a8c0d7005c7..42f5f1e54fcc 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c @@ -514,7 +514,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) ==