summaryrefslogtreecommitdiff
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2024-04-17 21:10:40 +0300
committerTheodore Ts'o <tytso@mit.edu>2024-05-07 15:44:40 -0400
commit3f4830abd236d0428e50451e1ecb62e14c365e9b (patch)
tree655952071b2e3c64d89d65923f6f41bf0fb35163 /fs/ext4/mballoc.c
parentc84f1510fba9fb181e6a1aa7b5fcfc67381b39c9 (diff)
ext4: fix potential unnitialized variable
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>
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index ac0ee747f4b9..648989c125f2 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -6126,6 +6126,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;
}