From 064659d51964b8029d613fb4a5ae9994793a853b Mon Sep 17 00:00:00 2001 From: tappro Date: Thu, 31 Aug 2006 21:48:05 +0000 Subject: [PATCH] small fix to avoid using NULL pointer --- lustre/cmm/cmm_device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lustre/cmm/cmm_device.c b/lustre/cmm/cmm_device.c index f8e346d..a0a9476 100644 --- a/lustre/cmm/cmm_device.c +++ b/lustre/cmm/cmm_device.c @@ -180,8 +180,10 @@ static void cmm_device_shutdown(const struct lu_context *ctx, spin_unlock(&cm->cmm_tgt_guard); ls = cm->cmm_md_dev.md_lu_dev.ld_site; - fld_client_fini(ls->ls_client_fld); - OBD_FREE_PTR(ls->ls_client_fld); + if (ls->ls_client_fld != NULL) { + fld_client_fini(ls->ls_client_fld); + OBD_FREE_PTR(ls->ls_client_fld); + } ls->ls_client_fld = NULL; EXIT; -- 1.8.3.1