[PATCH] btrfs: scrub: initialize variable explicitly

From: Ou Shixiong
Date: Wed Jun 07 2023 - 22:49:23 EST



Fix error of
error: â??retâ?? may be used uninitialized in this function [-Werror=maybe-uninitialized]

Signed-off-by: Ou Shixiong <oushixiong@xxxxxxxxxx>
---
fs/btrfs/scrub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 28caad17ccc7..0d5c87c52c33 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -1962,7 +1962,7 @@ static int scrub_simple_mirror(struct scrub_ctx *sctx,
/* An artificial limit, inherit from old scrub behavior */
struct btrfs_path path = { 0 };
u64 cur_logical = logical_start;
- int ret;
+ int ret = 0;

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

Content-type: Text/plain

No virus found
Checked by Hillstone Network AntiVirus