From a85c8e17587e81e1c82f6f341a81e4c778fa65f6 Mon Sep 17 00:00:00 2001 From: roel kluin Date: Tue, 19 May 2009 14:58:56 +0000 Subject: [PATCH] tape: beyond ARRAY_SIZE of viocd_diskinfo Do not go beyond ARRAY_SIZE of tape_device and viotape_unitinfo Signed-off-by: Roel Kluin Acked-by: Stephen Rothwell Signed-off-by: Benjamin Herrenschmidt --- drivers/char/viotape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c index ffc9254f7e0..042c8149a6d 100644 --- a/drivers/char/viotape.c +++ b/drivers/char/viotape.c @@ -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;