[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220926100755.058030217@linuxfoundation.org>
Date: Mon, 26 Sep 2022 12:12:26 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Brian Foster <bfoster@...hat.com>,
"Darrick J. Wong" <djwong@...nel.org>,
Chandan Babu R <chandan.babu@...cle.com>
Subject: [PATCH 5.4 113/120] xfs: fix some memory leaks in log recovery
From: "Darrick J. Wong" <darrick.wong@...cle.com>
commit 050552cbe06a3a9c3f977dcf11ff998ae1d5c2d5 upstream.
Fix a few places where we xlog_alloc_buffer a buffer, hit an error, and
then bail out without freeing the buffer.
Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>
Reviewed-by: Brian Foster <bfoster@...hat.com>
Acked-by: Darrick J. Wong <djwong@...nel.org>
Signed-off-by: Chandan Babu R <chandan.babu@...cle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/xfs/xfs_log_recover.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1347,10 +1347,11 @@ xlog_find_tail(
error = xlog_rseek_logrec_hdr(log, *head_blk, *head_blk, 1, buffer,
&rhead_blk, &rhead, &wrapped);
if (error < 0)
- return error;
+ goto done;
if (!error) {
xfs_warn(log->l_mp, "%s: couldn't find sync record", __func__);
- return -EFSCORRUPTED;
+ error = -EFSCORRUPTED;
+ goto done;
}
*tail_blk = BLOCK_LSN(be64_to_cpu(rhead->h_tail_lsn));
@@ -5318,7 +5319,8 @@ xlog_do_recovery_pass(
} else {
XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW,
log->l_mp);
- return -EFSCORRUPTED;
+ error = -EFSCORRUPTED;
+ goto bread_err1;
}
}
Powered by blists - more mailing lists