Skip to content

Commit a50bda1

Browse files
Su Huitytso
authored andcommitted
ext4: mballoc: avoid garbage value from err
clang's static analysis warning: fs/ext4/mballoc.c line 4178, column 6, Branch condition evaluates to a garbage value. err is uninitialized and will be judged when 'len <= 0' or it first enters the loop while the condition "!ext4_sb_block_valid()" is true. Although this can't make problems now, it's better to correct it. Signed-off-by: Su Hui <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 79ebf48 commit a50bda1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/mballoc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4087,7 +4087,7 @@ void ext4_mb_mark_bb(struct super_block *sb, ext4_fsblk_t block,
40874087
struct ext4_sb_info *sbi = EXT4_SB(sb);
40884088
ext4_group_t group;
40894089
ext4_grpblk_t blkoff;
4090-
int i, err;
4090+
int i, err = 0;
40914091
int already;
40924092
unsigned int clen, clen_changed, thisgrp_len;
40934093

0 commit comments

Comments
 (0)