提交 008d0cf1 编写于 作者: D Dan Carpenter 提交者: Ralf Baechle

MIPS: Octeon: Off by one in octeon_irq_gpio_map()

It should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().

Fixes: 64b139f9 ('MIPS: OCTEON: irq: add CIB and other fixes')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NDavid Daney <david.daney@cavium.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-mips@linux-mips.org
Cc: kernel-janitors@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/13813/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 b4e76f7e
......@@ -1260,7 +1260,7 @@ static int octeon_irq_gpio_map(struct irq_domain *d,
line = (hw + gpiod->base_hwirq) >> 6;
bit = (hw + gpiod->base_hwirq) & 63;
if (line > ARRAY_SIZE(octeon_irq_ciu_to_irq) ||
if (line >= ARRAY_SIZE(octeon_irq_ciu_to_irq) ||
octeon_irq_ciu_to_irq[line][bit] != 0)
return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册