Skip to content

Commit

Permalink
tape: beyond ARRAY_SIZE of viocd_diskinfo
Browse files Browse the repository at this point in the history
Do not go beyond ARRAY_SIZE of tape_device and viotape_unitinfo

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
roel kluin authored and Benjamin Herrenschmidt committed Jun 2, 2009
1 parent 2d8ae63 commit a85c8e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/viotape.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
int j;
struct device_node *node = vdev->dev.archdata.of_node;

if (i > VIOTAPE_MAX_TAPE)
if (i >= VIOTAPE_MAX_TAPE)
return -ENODEV;
if (!node)
return -ENODEV;
Expand Down

0 comments on commit a85c8e1

Please sign in to comment.