From: yury Date: Thu, 23 Oct 2008 11:00:17 +0000 (+0000) Subject: b=17447 X-Git-Tag: v1_7_130~1^143~3 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7c6c7daba5603af4d9e818b0182ce5c17458a6b2;p=fs%2Flustre-release.git b=17447 r=adilger,deen - fixes existing and possible memory leaks; - cleanups. --- diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 3a9d4d1..eda715e 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -2167,6 +2167,7 @@ static int mds_lov_clean(struct obd_device *obd) static int mds_postsetup(struct obd_device *obd) { struct mds_obd *mds = &obd->u.mds; + struct llog_ctxt *ctxt; int rc = 0; ENTRY; @@ -2178,7 +2179,7 @@ static int mds_postsetup(struct obd_device *obd) rc = llog_setup(obd, LLOG_LOVEA_ORIG_CTXT, obd, 0, NULL, &llog_lvfs_ops); if (rc) - RETURN(rc); + GOTO(err_llog, rc); if (mds->mds_profile) { struct lustre_profile *lprof; @@ -2201,9 +2202,14 @@ static int mds_postsetup(struct obd_device *obd) err_cleanup: mds_lov_clean(obd); - llog_cleanup(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT)); - llog_cleanup(llog_get_context(obd, LLOG_LOVEA_ORIG_CTXT)); - RETURN(rc); + ctxt = llog_get_context(obd, LLOG_LOVEA_ORIG_CTXT); + if (ctxt) + llog_cleanup(ctxt); +err_llog: + ctxt = llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT); + if (ctxt) + llog_cleanup(ctxt); + return rc; } int mds_postrecov(struct obd_device *obd)