Skip to content

Commit

Permalink
cdrom: beyond ARRAY_SIZE of viocd_diskinfo
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and Jens Axboe committed May 20, 2009
1 parent 31a1440 commit d3375ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cdrom/viocd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d3375ea

Please sign in to comment.