Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a85c8e17 authored by roel kluin's avatar roel kluin Committed by Benjamin Herrenschmidt
Browse files

tape: beyond ARRAY_SIZE of viocd_diskinfo



Do not go beyond ARRAY_SIZE of tape_device and viotape_unitinfo

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Acked-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 2d8ae638
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;