From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH 2/2] f2fs-tools: fix to avoid uninitialized variable access
Date: Tue, 10 Mar 2026 20:06:56 +0800 [thread overview]
Message-ID: <20260310120656.604210-2-chao@kernel.org> (raw)
In-Reply-To: <20260310120656.604210-1-chao@kernel.org>
Fix below compile warning:
CC fibmap.o
In function ‘stat_bdev’,
inlined from ‘main’ at fibmap.c:171:2:
fibmap.c:123:9: warning: ‘start_lba’ may be used uninitialized [-Wmaybe-uninitialized]
123 | printf("start_lba = %u\n", *start_lba);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fibmap.c: In function ‘main’:
fibmap.c:143:15: note: ‘start_lba’ was declared here
143 | __u32 start_lba;
| ^~~~~~~~~
Signed-off-by: Chao Yu <chao@kernel.org>
---
tools/fibmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/fibmap.c b/tools/fibmap.c
index 0a92551..dea5361 100644
--- a/tools/fibmap.c
+++ b/tools/fibmap.c
@@ -140,7 +140,7 @@ int main(int argc, char *argv[])
int total_blks;
unsigned int i;
struct file_ext ext;
- __u32 start_lba;
+ __u32 start_lba = 0;
__u32 blknum;
if (argc != 2) {
--
2.49.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
prev parent reply other threads:[~2026-03-10 12:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 12:06 [f2fs-dev] [PATCH 1/2] f2fs-tools: fix to use HDIO_GETGEO instead of HDIO_GETGIO Chao Yu via Linux-f2fs-devel
2026-03-10 12:06 ` Chao Yu via Linux-f2fs-devel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260310120656.604210-2-chao@kernel.org \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox