Commit c1cc9b97 authored by Axel Lin's avatar Axel Lin Committed by Linus Torvalds

pl061: fix offset value range checking

The valid offset value is 0..PL061_GPIO_NR-1, this patch corrects the
offset value range checking.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarBaruch Siach <baruch@tkos.co.il>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7839ec78
......@@ -164,7 +164,7 @@ static int pl061_irq_type(unsigned irq, unsigned trigger)
unsigned long flags;
u8 gpiois, gpioibe, gpioiev;
if (offset < 0 || offset > PL061_GPIO_NR)
if (offset < 0 || offset >= PL061_GPIO_NR)
return -EINVAL;
spin_lock_irqsave(&chip->irq_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment