]> git.baikalelectronics.ru Git - kernel.git/commit
block: sunvdc: add check for mdesc_grab() returning NULL
authorLiang He <windhl@126.com>
Wed, 15 Mar 2023 06:20:32 +0000 (14:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:28:06 +0000 (13:28 +0100)
commit2d3e4656569db64694179b9f96df1f84063d01a8
treeac49082c2496f0192e5a6cb6adfdbd5c4cb422ba
parenta8bc2260cd075c854beee9443499389fdf85807e
block: sunvdc: add check for mdesc_grab() returning NULL

[ Upstream commit 6030363199e3a6341afb467ddddbed56640cbf6a ]

In vdc_port_probe(), we should check the return value of mdesc_grab() as
it may return NULL, which can cause potential NPD bug.

Fixes: 136a29bb9255 ("[SPARC64]: Abstract out mdesc accesses for better MD update handling.")
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20230315062032.1741692-1-windhl@126.com
[axboe: style cleanup]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/sunvdc.c