mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] pl061: Trivial fix for offset value range checking
@ 2010-04-06  5:33 Axel Lin
  2010-04-07  4:42 ` Baruch Siach
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2010-04-06  5:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: David Brownell, Baruch Siach

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] pl061: Trivial fix for offset value range checking
  2010-04-06  5:33 [PATCH] pl061: Trivial fix for offset value range checking Axel Lin
@ 2010-04-07  4:42 ` Baruch Siach
  0 siblings, 0 replies; 2+ messages in thread
From: Baruch Siach @ 2010-04-07  4:42 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, David Brownell

Hi Axel,

On Tue, Apr 06, 2010 at 01:33:09PM +0800, Axel Lin wrote:
> 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>

Thanks.

baruch

> ---
>  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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-07  5:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-06  5:33 [PATCH] pl061: Trivial fix for offset value range checking Axel Lin
2010-04-07  4:42 ` Baruch Siach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome