]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ext4: fix potential unnitialized variable
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 17 Apr 2024 18:10:40 +0000 (21:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:32:14 +0000 (13:32 +0200)
[ 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 <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/363a4673-0fb8-4adf-b4fb-90a499077276@moroto.mountain
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/mballoc.c

index 099007ec774c78312924d3d21a5fc87cdd71cae2..87378d08a414bd89b15626b24ecb7df1e861c17b 100644 (file)
@@ -5147,6 +5147,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;
 }