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: 43fdf27470b2 ("[SPARC64]: Abstract out mdesc accesses for better MD update handling.") Signed-off-by: Liang He <windhl@xxxxxxx> --- drivers/block/sunvdc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c index fb855da971ee..d24a78199cdb 100644 --- a/drivers/block/sunvdc.c +++ b/drivers/block/sunvdc.c @@ -973,6 +973,9 @@ static int vdc_port_probe(struct vio_dev *vdev, const struct vio_device_id *id) hp = mdesc_grab(); + if (!hp) + return -ENODEV; + err = -ENODEV; if ((vdev->dev_no << PARTITION_SHIFT) & ~(u64)MINORMASK) { printk(KERN_ERR PFX "Port id [%llu] too large.\n", -- 2.25.1