Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3375ea7 authored by Roel Kluin's avatar Roel Kluin Committed by Jens Axboe
Browse files

cdrom: beyond ARRAY_SIZE of viocd_diskinfo



Do not go beyond ARRAY_SIZE of viocd_diskinfo

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 31a14400
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
	struct device_node *node = vdev->dev.archdata.of_node;


	deviceno = vdev->unit_address;
	deviceno = vdev->unit_address;
	if (deviceno > VIOCD_MAX_CD)
	if (deviceno >= VIOCD_MAX_CD)
		return -ENODEV;
		return -ENODEV;
	if (!node)
	if (!node)
		return -ENODEV;
		return -ENODEV;