drivers/md/md-bitmap: check the return value of md_bitmap_get_counter()
authorLi Zhong <floridsleeves@gmail.com>
Fri, 16 Sep 2022 23:33:05 +0000 (16:33 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:33:01 +0000 (13:33 +0100)
commit99bef41f8e8d1d52b5cb34f2f193f1346192752b
treefc8733338b9504e4c06d7f5c55140b588b5ba36e
parent302c0a8ed3bcf32e251990e74e24bd33d66d3df6
drivers/md/md-bitmap: check the return value of md_bitmap_get_counter()

[ Upstream commit 3bd548e5b819b8c0f2c9085de775c5c7bff9052f ]

Check the return value of md_bitmap_get_counter() in case it returns
NULL pointer, which will result in a null pointer dereference.

v2: update the check to include other dereference

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/md-bitmap.c