Skip to content

Commit eef855a

Browse files
Lu YaoSasha Levin
Lu Yao
authored and
Sasha Levin
committed
btrfs: scrub: initialize ret in scrub_simple_mirror() to fix compilation warning
[ Upstream commit b4e585f ] The following error message is displayed: ../fs/btrfs/scrub.c:2152:9: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]" Compiler version: gcc version: (Debian 10.2.1-6) 10.2.1 20210110 Reviewed-by: Boris Burkov <[email protected]> Signed-off-by: Lu Yao <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 92f5bec commit eef855a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/scrub.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3407,7 +3407,7 @@ static int scrub_simple_mirror(struct scrub_ctx *sctx,
34073407
const u32 max_length = SZ_64K;
34083408
struct btrfs_path path = { 0 };
34093409
u64 cur_logical = logical_start;
3410-
int ret;
3410+
int ret = 0;
34113411

34123412
/* The range must be inside the bg */
34133413
ASSERT(logical_start >= bg->start && logical_end <= bg->start + bg->length);

0 commit comments

Comments
 (0)