From: Dan Carpenter Date: Wed, 17 Apr 2024 18:10:40 +0000 (+0300) Subject: ext4: fix potential unnitialized variable X-Git-Tag: v5.15.161~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ae762f26b671528595237a122e396138b0623d9;p=thirdparty%2Fkernel%2Fstable.git ext4: fix potential unnitialized variable [ Upstream commit 3f4830abd236d0428e50451e1ecb62e14c365e9b ] 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 Link: https://lore.kernel.org/r/363a4673-0fb8-4adf-b4fb-90a499077276@moroto.mountain Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index e85123e447f14..1145664a0bb71 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -5684,6 +5684,7 @@ ext4_mb_new_blocks_simple(struct ext4_allocation_request *ar, int *errp) ext4_mb_mark_bb(sb, block, 1, 1); ar->len = 1; + *errp = 0; return block; }