diff options
author | Dan Carpenter <[email protected]> | 2016-07-14 13:14:29 +0300 |
---|---|---|
committer | Ralf Baechle <[email protected]> | 2016-07-21 11:20:10 +0200 |
commit | 008d0cf1ec69ec6d2c08f2d23aff2b67cbe5d2af (patch) | |
tree | fd92b4b71d08d93d25a3388c53b50390bf398fce | |
parent | b4e76f7e6d3200462c6354a6ad4ae167459e61f8 (diff) |
MIPS: Octeon: Off by one in octeon_irq_gpio_map()
It should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().
Fixes: 64b139f97c01 ('MIPS: OCTEON: irq: add CIB and other fixes')
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: David Daney <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/13813/
Signed-off-by: Ralf Baechle <[email protected]>
-rw-r--r-- | arch/mips/cavium-octeon/octeon-irq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index 368eb490354c..75a4add63a28 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c @@ -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; |