From: nathan Date: Tue, 24 Jul 2007 15:20:50 +0000 (+0000) Subject: b=12707 X-Git-Tag: v1_8_0_110~1430 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2761c4f57ffb66d2571d56e5d3625369595909d5;p=fs%2Flustre-release.git b=12707 i=adilger i=nathan coverity --- diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 73b5d20..e5ce038 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -771,7 +771,8 @@ static int lustre_stop_mgc(struct super_block *sb) /* Clean the nid uuids */ if (!niduuid) - RETURN(-ENOMEM); + GOTO(out, rc = -ENOMEM); + for (i = 0; i < lsi->lsi_lmd->lmd_mgs_failnodes; i++) { sprintf(ptr, "_%x", i); rc = do_lcfg(LUSTRE_MGC_OBDNAME, 0, LCFG_DEL_UUID, @@ -780,10 +781,11 @@ static int lustre_stop_mgc(struct super_block *sb) CERROR("del MDC UUID %s failed: rc = %d\n", niduuid, rc); } - OBD_FREE(niduuid, len); - /* class_import_put will get rid of the additional connections */ - out: + if (niduuid) + OBD_FREE(niduuid, len); + + /* class_import_put will get rid of the additional connections */ mutex_up(&mgc_start_lock); RETURN(rc); }