]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ext4: fix potential null dereference in ext4 kunit test
authorCharles Han <hanchunchao@inspur.com>
Fri, 10 Jan 2025 09:24:21 +0000 (17:24 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 13 Mar 2025 14:01:14 +0000 (10:01 -0400)
commit57e7239ce0ed14e81e414c99d57f516f6220a995
tree7b2d402f8ff011e6b1d196b60ab8ae1224820bdd
parent30cbe84d48d7d704fdaaf5179a0f4e0764ca35ab
ext4: fix potential null dereference in ext4 kunit test

kunit_kzalloc() may return a NULL pointer, dereferencing it
without NULL check may lead to NULL dereference.
Add a NULL check for grp.

Fixes: ac96b56a2fbd ("ext4: Add unit test for mb_mark_used")
Fixes: b7098e1fa7bc ("ext4: Add unit test for mb_free_blocks")
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Reviewed-by: Kemeng Shi <shikemeng@huaweicloud.com>
Link: https://patch.msgid.link/20250110092421.35619-1-hanchunchao@inspur.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc-test.c