提交 a85c8e17 编写于 作者: R roel kluin 提交者: Benjamin Herrenschmidt

tape: beyond ARRAY_SIZE of viocd_diskinfo

Do not go beyond ARRAY_SIZE of tape_device and viotape_unitinfo
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Acked-by: NStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 2d8ae638
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册