From: Roel Kluin Date: Wed, 20 May 2009 06:42:06 +0000 (+0200) Subject: cdrom: beyond ARRAY_SIZE of viocd_diskinfo X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d3375ea7213d09284ee3683d8bc075b9d3786a03;p=linux-beck.git cdrom: beyond ARRAY_SIZE of viocd_diskinfo Do not go beyond ARRAY_SIZE of viocd_diskinfo Signed-off-by: Roel Kluin Signed-off-by: Jens Axboe --- diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c index 13929356135c..9b1624e0ddeb 100644 --- a/drivers/cdrom/viocd.c +++ b/drivers/cdrom/viocd.c @@ -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;