public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] btrfs: Initialize ret to 0 in scrub_simple_mirror()
@ 2022-02-20 14:46 Souptick Joarder
  2022-02-21  0:15 ` Qu Wenruo
  0 siblings, 1 reply; 11+ messages in thread
From: Souptick Joarder @ 2022-02-20 14:46 UTC (permalink / raw)
  To: clm, josef, dsterba, nathan, ndesaulniers
  Cc: linux-btrfs, linux-kernel, llvm, Souptick Joarder (HPE),
	kernel test robot

From: "Souptick Joarder (HPE)" <jrdr.linux@gmail.com>

Kernel test robot reported below warning ->
fs/btrfs/scrub.c:3439:2: warning: Undefined or garbage value
returned to caller [clang-analyzer-core.uninitialized.UndefReturn]

Initialize ret to 0.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
---
 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 4baa8e43d585..5ca7e5ffbc96 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -3325,7 +3325,7 @@ static int scrub_simple_mirror(struct scrub_ctx *sctx,
 	const u32 max_length = SZ_64K;
 	struct btrfs_path path = {};
 	u64 cur_logical = logical_start;
-	int ret;
+	int ret = 0;
 
 	/* The range must be inside the bg */
 	ASSERT(logical_start >= bg->start &&
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-03-01  1:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-20 14:46 [PATCH] btrfs: Initialize ret to 0 in scrub_simple_mirror() Souptick Joarder
2022-02-21  0:15 ` Qu Wenruo
2022-02-22  7:50   ` Souptick Joarder
2022-02-22  8:04     ` Qu Wenruo
2022-02-22  8:09       ` Souptick Joarder
2022-02-24  9:48       ` Yujie Liu
2022-02-24  9:56         ` Qu Wenruo
2022-02-25  9:35           ` Yujie Liu
2022-02-25  5:16         ` Souptick Joarder
2022-02-25 10:02           ` Yujie Liu
2022-03-01  1:55             ` Yujie Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox