block: sunvdc: add check for mdesc_grab()
PATCH 1/1 block: sunvdc: add check for mdesc_grab()
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 <[email protected]>
--- drivers/block/sunvdc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/block/sunvdc.c +3 -0
@@ -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",
Signature · 1 line
2.25.1
Quoted 5 lines · Liang He
In
vdc_port_probe(), we should check the return value ofmdesc_grab()as it may return NULL, which can cause potential NPD bug.
Applied, thanks!
[1/1] block: sunvdc: add check for mdesc_grab()
commit: 6030363199e3a6341afb467ddddbed56640cbf6a
Best regards,
Signature · 1 line
Jens Axboe