Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3daeb42c authored by Dave Chinner's avatar Dave Chinner Committed by Alex Elder
Browse files

xfs: fix missing error check in xfs_rtfree_range



When xfs_rtfind_forw() returns an error, the block is returned
uninitialised.  xfs_rtfree_range() is not checking the error return,
so could be using an uninitialised block number for modifying bitmap
summary info.

The problem was found by gcc when compiling the *userspace* libxfs
code - it is an copy of the kernel code with the exact same bug.
gcc gives an uninitialised variable warning on the userspace code
but not on the kernel code. You gotta love the consistency (Mmmm,
slightly chewy today!).

Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
parent 4b6a4688
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1517,6 +1517,8 @@ xfs_rtfree_range(
	 */
	 */
	error = xfs_rtfind_forw(mp, tp, end, mp->m_sb.sb_rextents - 1,
	error = xfs_rtfind_forw(mp, tp, end, mp->m_sb.sb_rextents - 1,
		&postblock);
		&postblock);
	if (error)
		return error;
	/*
	/*
	 * If there are blocks not being freed at the front of the
	 * If there are blocks not being freed at the front of the
	 * old extent, add summary data for them to be allocated.
	 * old extent, add summary data for them to be allocated.