mirror of
https://github.com/torvalds/linux.git
synced 2024-12-18 00:53:40 +00:00
cdrom: beyond ARRAY_SIZE of viocd_diskinfo
Do not go beyond ARRAY_SIZE of viocd_diskinfo Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
parent
31a14400e8
commit
d3375ea721
@ -587,7 +587,7 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
||||
struct device_node *node = vdev->dev.archdata.of_node;
|
||||
|
||||
deviceno = vdev->unit_address;
|
||||
if (deviceno > VIOCD_MAX_CD)
|
||||
if (deviceno >= VIOCD_MAX_CD)
|
||||
return -ENODEV;
|
||||
if (!node)
|
||||
return -ENODEV;
|
||||
|
Loading…
Reference in New Issue
Block a user