Skip to content

Commit a8867f4

Browse files
PhilPottertytso
authored andcommitted
ext4: fix memory leak in ext4_mb_init_backend on error path.
Fix a memory leak discovered by syzbot when a file system is corrupted with an illegally large s_log_groups_per_flex. Reported-by: [email protected] Signed-off-by: Phillip Potter <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 6c09127 commit a8867f4

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
@@ -3217,7 +3217,7 @@ static int ext4_mb_init_backend(struct super_block *sb)
32173217
*/
32183218
if (sbi->s_es->s_log_groups_per_flex >= 32) {
32193219
ext4_msg(sb, KERN_ERR, "too many log groups per flexible block group");
3220-
goto err_freesgi;
3220+
goto err_freebuddy;
32213221
}
32223222
sbi->s_mb_prefetch = min_t(uint, 1 << sbi->s_es->s_log_groups_per_flex,
32233223
BLK_MAX_SEGMENT_SIZE >> (sb->s_blocksize_bits - 9));

0 commit comments

Comments
 (0)