diff options
author | Dave Chinner <david@fromorbit.com> | 2010-01-14 03:44:46 -0500 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-01-15 14:46:19 -0500 |
commit | 3daeb42c13567e1505f233f6a699cc0e23c8ab5a (patch) | |
tree | a5897b35cb4830d73089aace8abd5b2c8bae1d7f /fs/xfs/xfs_rtalloc.c | |
parent | 4b6a46882cca8349e8942e2650c33b11bc571c92 (diff) |
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: Dave Chinner <david@fromorbit.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
-rw-r--r-- | fs/xfs/xfs_rtalloc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 9e15a118536..6be05f756d5 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c | |||
@@ -1517,6 +1517,8 @@ xfs_rtfree_range( | |||
1517 | */ | 1517 | */ |
1518 | error = xfs_rtfind_forw(mp, tp, end, mp->m_sb.sb_rextents - 1, | 1518 | error = xfs_rtfind_forw(mp, tp, end, mp->m_sb.sb_rextents - 1, |
1519 | &postblock); | 1519 | &postblock); |
1520 | if (error) | ||
1521 | return error; | ||
1520 | /* | 1522 | /* |
1521 | * If there are blocks not being freed at the front of the | 1523 | * If there are blocks not being freed at the front of the |
1522 | * old extent, add summary data for them to be allocated. | 1524 | * old extent, add summary data for them to be allocated. |