]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fixup possible uninitialized variable access in ext4_mb_choose_next_group_cr1()
authorJan Kara <jack@suse.cz>
Thu, 22 Sep 2022 09:09:29 +0000 (11:09 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 26 Sep 2022 17:21:05 +0000 (13:21 -0400)
commit2b5ff6a2b6afde63268282280c6c9ac5cc2b7656
tree33d02c3b2b5b18ad68d377b6eb1fbd1c6c2f5702
parent6dd402e91bf23f637eb9ef1ffe8633b7276e74b9
ext4: fixup possible uninitialized variable access in ext4_mb_choose_next_group_cr1()

Variable 'grp' may be left uninitialized if there's no group with
suitable average fragment size (or larger). Fix the problem by
initializing it earlier.

Link: https://lore.kernel.org/r/20220922091542.pkhedytey7wzp5fi@quack3
Fixes: 2ff27555f7ed ("ext4: use buckets for cr 1 block scan instead of rbtree")
Cc: stable@kernel.org
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c