summaryrefslogtreecommitdiffstats
path: root/fs/xfs/scrub/dabtree.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2017-11-02 20:48:11 +0100
committerDarrick J. Wong <darrick.wong@oracle.com>2017-11-03 17:45:56 +0100
commit0dca060c2a5a83dc8bd28eb2d8b559bd33238175 (patch)
treeef12f345c836461cdeef2d6de6f30155f009c9ab /fs/xfs/scrub/dabtree.c
parentxfs: truncate pagecache before writeback in xfs_setattr_size() (diff)
downloadlinux-0dca060c2a5a83dc8bd28eb2d8b559bd33238175.tar.xz
linux-0dca060c2a5a83dc8bd28eb2d8b559bd33238175.zip
xfs: scrub: avoid uninitialized return code
The newly added xfs_scrub_da_btree_block() function has one code path that returns the 'error' variable without initializing it first, as shown by this compiler warning: fs/xfs/scrub/dabtree.c: In function 'xfs_scrub_da_btree_block': fs/xfs/scrub/dabtree.c:462:9: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized] Return zero since the caller will exit the scrub code if we don't produce a buffer pointer. Fixes: 7c4a07a424c1 ("xfs: scrub directory/attribute btrees") Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/dabtree.c')
-rw-r--r--fs/xfs/scrub/dabtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c
index c21c52812e57..4c9839c40163 100644
--- a/fs/xfs/scrub/dabtree.c
+++ b/fs/xfs/scrub/dabtree.c
@@ -336,7 +336,7 @@ xfs_scrub_da_btree_block(
xfs_ino_t owner;
int *pmaxrecs;
struct xfs_da3_icnode_hdr nodehdr;
- int error;
+ int error = 0;
blk = &ds->state->path.blk[level];
ds->state->path.active = level + 1;