mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
block: sunvdc: add check for mdesc_grab() returning NULL
[ Upstream commit6030363199] 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:43fdf27470("[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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a6317235da
commit
2f28cb5c2a
@@ -984,6 +984,8 @@ static int vdc_port_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
|||||||
print_version();
|
print_version();
|
||||||
|
|
||||||
hp = mdesc_grab();
|
hp = mdesc_grab();
|
||||||
|
if (!hp)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
err = -ENODEV;
|
err = -ENODEV;
|
||||||
if ((vdev->dev_no << PARTITION_SHIFT) & ~(u64)MINORMASK) {
|
if ((vdev->dev_no << PARTITION_SHIFT) & ~(u64)MINORMASK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user