mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-17 20:29:24 +00:00
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>
This commit is contained in:
parent
7839ec7821
commit
c1cc9b9775
1 changed files with 1 additions and 1 deletions
|
@ -164,7 +164,7 @@ static int pl061_irq_type(unsigned irq, unsigned trigger)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u8 gpiois, gpioibe, gpioiev;
|
u8 gpiois, gpioibe, gpioiev;
|
||||||
|
|
||||||
if (offset < 0 || offset > PL061_GPIO_NR)
|
if (offset < 0 || offset >= PL061_GPIO_NR)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
spin_lock_irqsave(&chip->irq_lock, flags);
|
spin_lock_irqsave(&chip->irq_lock, flags);
|
||||||
|
|
Loading…
Add table
Reference in a new issue