[PATCH] pl061: Trivial fix for offset value range checking

Previous thread: in x86 architecture ,why the function atomic_sub_and_test() does not disable the interrupt? by =?UTF-8?B?5p2o56GV?= on Monday, April 5, 2010 - 10:13 pm. (3 messages)

Next thread: [RESEND PATCH v2 0/6] lis3lv02d: click and threshold interrupts by Samu Onkalo on Monday, April 5, 2010 - 10:58 pm. (7 messages)
From: Axel Lin
Date: Monday, April 5, 2010 - 10:33 pm

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>
---
 drivers/gpio/pl061.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/pl061.c b/drivers/gpio/pl061.c
index 5ad8f77..8e0906a 100644
--- a/drivers/gpio/pl061.c
+++ b/drivers/gpio/pl061.c
@@ -158,7 +158,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);
-- 
1.5.4.3
--

From: Baruch Siach
Date: Tuesday, April 6, 2010 - 9:42 pm

Hi Axel,


Acked-by: Baruch Siach <baruch@tkos.co.il>

Thanks.


-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
--

Previous thread: in x86 architecture ,why the function atomic_sub_and_test() does not disable the interrupt? by =?UTF-8?B?5p2o56GV?= on Monday, April 5, 2010 - 10:13 pm. (3 messages)

Next thread: [RESEND PATCH v2 0/6] lis3lv02d: click and threshold interrupts by Samu Onkalo on Monday, April 5, 2010 - 10:58 pm. (7 messages)