Skip to contentSkip to conversation

tape: beyond ARRAY_SIZE of viocd_diskinfo

PATCH New Roel Kluin 1 participant 1 message May 20, 2009 Char and misc drivers

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 tape: beyond ARRAY_SIZE of viocd_diskinfo

Do not go beyond ARRAY_SIZE of tape_device and viotape_unitinfo

---

drivers/char/viotape.c +1 -1
index ffc9254..042c814 100644
@@ -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;