diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2018-01-03 13:42:03 -0600 |
---|---|---|
committer | Eric Sandeen <sandeen@redhat.com> | 2018-01-03 13:42:03 -0600 |
commit | 5c40ca1fbca9c7b67b775b38063951e21308aebd (patch) | |
tree | bf4fcb1fd0601b96c09e1bbbd3a9abc06c125b83 | |
parent | dc9b1f58bffb702ea7f17720f9412677d903964a (diff) | |
download | xfsprogs-dev-5c40ca1fbca9c7b67b775b38063951e21308aebd.tar.gz |
xfs: fix leaks on corruption errors in xfs_bmap.c
Source kernel commit: d41c6172bd4031979eab722c265a2e5764383c3c
Use _GOTO instead of _RETURN so we can free the allocated
cursor on error.
Fixes: bf80628 ("xfs: remove xfs_bmse_shift_one")
Fixes-coverity-id: 1423813, 1423676
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r-- | libxfs/xfs_bmap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 195f0fb14d..50c3d112ff 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -5653,7 +5653,8 @@ xfs_bmap_collapse_extents( *done = true; goto del_cursor; } - XFS_WANT_CORRUPTED_RETURN(mp, !isnullstartblock(got.br_startblock)); + XFS_WANT_CORRUPTED_GOTO(mp, !isnullstartblock(got.br_startblock), + del_cursor); new_startoff = got.br_startoff - offset_shift_fsb; if (xfs_iext_peek_prev_extent(ifp, &icur, &prev)) { @@ -5758,7 +5759,8 @@ xfs_bmap_insert_extents( goto del_cursor; } } - XFS_WANT_CORRUPTED_RETURN(mp, !isnullstartblock(got.br_startblock)); + XFS_WANT_CORRUPTED_GOTO(mp, !isnullstartblock(got.br_startblock), + del_cursor); if (stop_fsb >= got.br_startoff + got.br_blockcount) { error = -EIO; |