mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fs: jffs2: silence false positive by always initializing variable
@ 2025-09-01 11:38 Ahmad Fatoum
  2025-09-03  6:14 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-09-01 11:38 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

buffer is not initialized when pointed is true, but that can't
happen, because, unlike Linux, we hardcode the value at 0.

clang warns about that though, so fix the warning by always
initializing buffer.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 fs/jffs2/readinode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index d56001e5cbb8..c205917619cd 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -30,7 +30,7 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
 	struct jffs2_raw_node_ref *ref = tn->fn->raw;
 	int err = 0, pointed = 0;
 	struct jffs2_eraseblock *jeb;
-	unsigned char *buffer;
+	unsigned char *buffer = NULL;
 	uint32_t crc, ofs, len;
 	size_t retlen;
 
-- 
2.47.2




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

* Re: [PATCH] fs: jffs2: silence false positive by always initializing variable
  2025-09-01 11:38 [PATCH] fs: jffs2: silence false positive by always initializing variable Ahmad Fatoum
@ 2025-09-03  6:14 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-09-03  6:14 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Mon, 01 Sep 2025 13:38:07 +0200, Ahmad Fatoum wrote:
> buffer is not initialized when pointed is true, but that can't
> happen, because, unlike Linux, we hardcode the value at 0.
> 
> clang warns about that though, so fix the warning by always
> initializing buffer.
> 
> 
> [...]

Applied, thanks!

[1/1] fs: jffs2: silence false positive by always initializing variable
      https://git.pengutronix.de/cgit/barebox/commit/?id=6d778f786e7f (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




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

end of thread, other threads:[~2025-09-03  6:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-01 11:38 [PATCH] fs: jffs2: silence false positive by always initializing variable Ahmad Fatoum
2025-09-03  6:14 ` Sascha Hauer

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