Skip to content

Commit

Permalink
pl061: fix offset value range checking
Browse files Browse the repository at this point in the history
The valid offset value is 0..PL061_GPIO_NR-1, this patch corrects the
offset value range checking.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Axel Lin authored and Linus Torvalds committed May 27, 2010
1 parent 7839ec7 commit c1cc9b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/pl061.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c1cc9b9

Please sign in to comment.