linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: fix potential unnitialized variable
@ 2024-04-17 18:10 Dan Carpenter
  2024-05-07 23:03 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-04-17 18:10 UTC (permalink / raw)
  To: Harshad Shirwadkar
  Cc: Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel,
	kernel-janitors

Smatch complains "err" can be uninitialized in the caller.

    fs/ext4/indirect.c:349 ext4_alloc_branch()
    error: uninitialized symbol 'err'.

Set the error to zero on the success path.

Fixes: 8016e29f4362 ("ext4: fast commit recovery path")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
This is a static checker fix and I don't know this code very well...
Please review it extra carefully.

 fs/ext4/mballoc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 12b3f196010b..714f83632e3f 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -6113,6 +6113,7 @@ ext4_mb_new_blocks_simple(struct ext4_allocation_request *ar, int *errp)
 	ext4_mb_mark_bb(sb, block, 1, true);
 	ar->len = 1;
 
+	*errp = 0;
 	return block;
 }
 
-- 
2.43.0


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

* Re: [PATCH] ext4: fix potential unnitialized variable
  2024-04-17 18:10 [PATCH] ext4: fix potential unnitialized variable Dan Carpenter
@ 2024-05-07 23:03 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2024-05-07 23:03 UTC (permalink / raw)
  To: Harshad Shirwadkar, Dan Carpenter
  Cc: Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel,
	kernel-janitors


On Wed, 17 Apr 2024 21:10:40 +0300, Dan Carpenter wrote:
> Smatch complains "err" can be uninitialized in the caller.
> 
>     fs/ext4/indirect.c:349 ext4_alloc_branch()
>     error: uninitialized symbol 'err'.
> 
> Set the error to zero on the success path.
> 
> [...]

Applied, thanks!

[1/1] ext4: fix potential unnitialized variable
      commit: 3f4830abd236d0428e50451e1ecb62e14c365e9b

Best regards,
-- 
Theodore Ts'o <tytso@mit.edu>

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

end of thread, other threads:[~2024-05-07 23:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 18:10 [PATCH] ext4: fix potential unnitialized variable Dan Carpenter
2024-05-07 23:03 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).