ext4: fix memory leak in ext4_mb_init_backend on error path.
authorPhillip Potter <phil@philpotter.co.uk>
Mon, 12 Apr 2021 07:38:37 +0000 (08:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jun 2021 11:39:26 +0000 (13:39 +0200)
commit2050c6e5b161e5e25ce3c420fef58b24fa388a49
treeaf0347795f57751372bd3922fd7be97364721713
parentfb86acc6236934e2b654f50d2a97fa77eac17859
ext4: fix memory leak in ext4_mb_init_backend on error path.

commit a8867f4e3809050571c98de7a2d465aff5e4daf5 upstream.

Fix a memory leak discovered by syzbot when a file system is corrupted
with an illegally large s_log_groups_per_flex.

Reported-by: syzbot+aa12d6106ea4ca1b6aae@syzkaller.appspotmail.com
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Cc: stable@kernel.org
Link: https://lore.kernel.org/r/20210412073837.1686-1-phil@philpotter.co.uk
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/mballoc.c