From: Swapnil Pimpale Date: Thu, 28 Apr 2016 01:37:14 +0000 (-0400) Subject: staging: lustre: obd: cleanup client import if client_obd_setup fails X-Git-Tag: v4.7-rc1~90^2~307 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d8555069e259a7fd8096527cab5b9e3dbf185225;p=karo-tx-linux.git staging: lustre: obd: cleanup client import if client_obd_setup fails client_obd_setup() allocates an obd_import which should be cleaned up if there is any failure afterwards in callers of client_obd_setup(). This patch fixes the bug in osc_setup(), mgc_setup(), mdc_setup() and lwp_setup(). The fix is to call obd_cleanup_client_import() before calling client_obd_cleanup() in case of an error. Signed-off-by: Swapnil Pimpale Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3810 Reviewed-on: http://review.whamcloud.com/7561 Reviewed-by: John L. Hammond Reviewed-by: Lai Siyao Reviewed-by: Andreas Dilger Signed-off-by: James Simmons 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 32486b217114..47911361e236 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c @@ -438,6 +438,7 @@ int client_obd_cleanup(struct obd_device *obddev) ldlm_namespace_free_post(obddev->obd_namespace); obddev->obd_namespace = NULL; + obd_cleanup_client_import(obddev); LASSERT(!obddev->u.cli.cl_import); ldlm_put_ref();