Skip to content

Commit 6030363

Browse files
windhlaxboe
authored andcommitted
block: sunvdc: add check for mdesc_grab() returning NULL
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: 43fdf27 ("[SPARC64]: Abstract out mdesc accesses for better MD update handling.") Signed-off-by: Liang He <[email protected]> Link: https://lore.kernel.org/r/[email protected] [axboe: style cleanup] Signed-off-by: Jens Axboe <[email protected]>
1 parent b640201 commit 6030363

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/block/sunvdc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,8 @@ static int vdc_port_probe(struct vio_dev *vdev, const struct vio_device_id *id)
972972
print_version();
973973

974974
hp = mdesc_grab();
975+
if (!hp)
976+
return -ENODEV;
975977

976978
err = -ENODEV;
977979
if ((vdev->dev_no << PARTITION_SHIFT) & ~(u64)MINORMASK) {

0 commit comments

Comments
 (0)