summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-05-26 14:42:19 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 09:12:41 -0700
commitc1cc9b9775c931a0015178daf92d41aec00580de (patch)
tree750cd8b9dc72d1e68597e8848cdffe8273ce1701 /drivers/gpio
parent7839ec78214ecf477cc9e2862233b8d9fcf4ec58 (diff)
downloadlinux-3.10-c1cc9b9775c931a0015178daf92d41aec00580de.tar.gz
linux-3.10-c1cc9b9775c931a0015178daf92d41aec00580de.tar.bz2
linux-3.10-c1cc9b9775c931a0015178daf92d41aec00580de.zip
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: 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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/pl061.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/pl061.c b/drivers/gpio/pl061.c
index 105701a1f05..ee568c8fcbd 100644
--- a/drivers/gpio/pl061.c
+++ b/drivers/gpio/pl061.c
@@ -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);