summaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-11-14 12:51:34 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2019-11-15 21:15:29 -0800
commit050552cbe06a3a9c3f977dcf11ff998ae1d5c2d5 (patch)
treecaf67a96006757a139fcee2b73f96a8299cdcfc1 /fs/xfs
parentf368b29ba917ac202c3901019b78f15f4d773085 (diff)
downloadlinux-050552cbe06a3a9c3f977dcf11ff998ae1d5c2d5.tar.bz2
xfs: fix some memory leaks in log recovery
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@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_log_recover.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 75d5c15b10d0..99ec3fba4548 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1342,10 +1342,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));
@@ -5300,7 +5301,8 @@ xlog_do_recovery_pass(
} else {
XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW,
log->l_mp);
- return -EFSCORRUPTED;
+ error = -EFSCORRUPTED;
+ goto bread_err1;
}
}