cdrom: beyond ARRAY_SIZE of viocd_diskinfo
authorRoel Kluin <roel.kluin@gmail.com>
Wed, 20 May 2009 06:42:06 +0000 (08:42 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 20 May 2009 06:42:06 +0000 (08:42 +0200)
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>
drivers/cdrom/viocd.c

index 13929356135c837743f130c2f7de4d3cd85cc4fb..9b1624e0ddeb5ae7615478c67ec03ec2f4a3a0e9 100644 (file)
@@ -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;