From bd6fbef8d770d5358b4dc6182c38b42810a0cbfb Mon Sep 17 00:00:00 2001 From: yury Date: Thu, 23 Oct 2008 11:00:13 +0000 Subject: [PATCH] b=17447 r=adilger,deen - fixes existing and possible memory leaks; - cleanups. --- lustre/lov/lov_log.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lustre/lov/lov_log.c b/lustre/lov/lov_log.c index a564410..eff8e77 100644 --- a/lustre/lov/lov_log.c +++ b/lustre/lov/lov_log.c @@ -212,7 +212,7 @@ int lov_llog_init(struct obd_device *obd, struct obd_device *tgt, rc = llog_setup(obd, LLOG_SIZE_REPL_CTXT, tgt, 0, NULL, &lov_size_repl_logops); if (rc) - RETURN(rc); + GOTO(err_cleanup, rc); lov_getref(obd); for (i = 0; i < lov->desc.ld_tgt_count ; i++) { @@ -233,7 +233,18 @@ int lov_llog_init(struct obd_device *obd, struct obd_device *tgt, } } lov_putref(obd); - RETURN(err); + GOTO(err_cleanup, err); +err_cleanup: + if (err) { + struct llog_ctxt *ctxt = + llog_get_context(obd, LLOG_SIZE_REPL_CTXT); + if (ctxt) + llog_cleanup(ctxt); + ctxt = llog_get_context(obd, LLOG_MDS_OST_ORIG_CTXT); + if (ctxt) + llog_cleanup(ctxt); + } + return err; } int lov_llog_finish(struct obd_device *obd, int count) -- 1.8.3.1