From: John L. Hammond Date: Sun, 9 Feb 2014 07:51:49 +0000 (-0500) Subject: lustre: don't leak llog handle in llog_cat_process_cb() X-Git-Tag: v4.14-rc1~7811^2~1193 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7345fb75e0ec4b2c84ece7ee4aabe8a0bdc06062;p=platform%2Fkernel%2Flinux-rpi.git lustre: don't leak llog handle in llog_cat_process_cb() An early return from llog_cat_process_cb() was leaking the llog handle. Fix this by not doing that. Signed-off-by: John L. Hammond Reviewed-on: http://review.whamcloud.com/7847 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4054 Reviewed-by: Andreas Dilger Reviewed-by: jacques-Charles Lafoucriere Reviewed-by: Mike Pershin Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/lustre/obdclass/llog_cat.c b/drivers/staging/lustre/lustre/obdclass/llog_cat.c index c0f3af7..1d999310 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_cat.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_cat.c @@ -551,9 +551,8 @@ int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh, if (rec->lrh_index < d->lpd_startcat) /* Skip processing of the logs until startcat */ - return 0; - - if (d->lpd_startidx > 0) { + rc = 0; + else if (d->lpd_startidx > 0) { struct llog_process_cat_data cd; cd.lpcd_first_idx = d->lpd_startidx; @@ -566,6 +565,7 @@ int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh, rc = llog_process_or_fork(env, llh, d->lpd_cb, d->lpd_data, NULL, false); } + llog_handle_put(llh); return rc;