提交 0dca060c 编写于 作者: D Darrick J. Wong

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: 7c4a07a4 ("xfs: scrub directory/attribute btrees")
Reported-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
上级 350976ae
...@@ -336,7 +336,7 @@ xfs_scrub_da_btree_block( ...@@ -336,7 +336,7 @@ xfs_scrub_da_btree_block(
xfs_ino_t owner; xfs_ino_t owner;
int *pmaxrecs; int *pmaxrecs;
struct xfs_da3_icnode_hdr nodehdr; struct xfs_da3_icnode_hdr nodehdr;
int error; int error = 0;
blk = &ds->state->path.blk[level]; blk = &ds->state->path.blk[level];
ds->state->path.active = level + 1; ds->state->path.active = level + 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册