提交 c1cc9b97 编写于 作者: A Axel Lin 提交者: 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: NAxel Lin <axel.lin@gmail.com>
Acked-by: NBaruch Siach <baruch@tkos.co.il>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册