]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Wed, 18 Jan 2023 10:41:36 +0000 (11:41 +0100)
commite6c50077e04f9b8d5790b27de83159ebfd43dd2d
tree7209c32c76d3e683960b11196595aa1c650b9e14
parentbb43c5a510bfec4eafd7c31b5e83c54c5e1b7a45
drivers/md/md-bitmap: check the return value of md_bitmap_get_counter()

[ Upstream commit 574f85714e7e91a83e3021b038744ce8e6b1b2fd ]

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