linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: Fix range check in of_gpio_simple_xlate()
@ 2012-04-04  0:02 Roland Stigge
  2012-04-04  0:11 ` Roland Stigge
  2012-04-07  3:45 ` Grant Likely
  0 siblings, 2 replies; 3+ messages in thread
From: Roland Stigge @ 2012-04-04  0:02 UTC (permalink / raw)
  To: linux-arm-kernel

This patch fixes a range check in of_gpio_simple_xlate() by replacing a
"> gc->ngpio" with ">= gc->ngpio" since range is from 0 to gc->ngpio - 1

Signed-off-by: Roland Stigge <stigge@antcom.de>

---

 Applies to v3.4-rc1

 drivers/of/gpio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.orig/drivers/of/gpio.c
+++ linux-2.6/drivers/of/gpio.c
@@ -140,7 +140,7 @@ int of_gpio_simple_xlate(struct gpio_chi
 	if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
 		return -EINVAL;
 
-	if (gpiospec->args[0] > gc->ngpio)
+	if (gpiospec->args[0] >= gc->ngpio)
 		return -EINVAL;
 
 	if (flags)

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

* [PATCH] gpio: Fix range check in of_gpio_simple_xlate()
  2012-04-04  0:02 [PATCH] gpio: Fix range check in of_gpio_simple_xlate() Roland Stigge
@ 2012-04-04  0:11 ` Roland Stigge
  2012-04-07  3:45 ` Grant Likely
  1 sibling, 0 replies; 3+ messages in thread
From: Roland Stigge @ 2012-04-04  0:11 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/04/12 02:02, Roland Stigge wrote:
> This patch fixes a range check in of_gpio_simple_xlate() by replacing a
> "> gc->ngpio" with ">= gc->ngpio" since range is from 0 to gc->ngpio - 1
> 
> Signed-off-by: Roland Stigge <stigge@antcom.de>

CC: stable at vger.kernel.org

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

* [PATCH] gpio: Fix range check in of_gpio_simple_xlate()
  2012-04-04  0:02 [PATCH] gpio: Fix range check in of_gpio_simple_xlate() Roland Stigge
  2012-04-04  0:11 ` Roland Stigge
@ 2012-04-07  3:45 ` Grant Likely
  1 sibling, 0 replies; 3+ messages in thread
From: Grant Likely @ 2012-04-07  3:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed,  4 Apr 2012 02:02:58 +0200, Roland Stigge <stigge@antcom.de> wrote:
> This patch fixes a range check in of_gpio_simple_xlate() by replacing a
> "> gc->ngpio" with ">= gc->ngpio" since range is from 0 to gc->ngpio - 1
> 
> Signed-off-by: Roland Stigge <stigge@antcom.de>

Applied, thanks.

g.

> 
> ---
> 
>  Applies to v3.4-rc1
> 
>  drivers/of/gpio.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-2.6.orig/drivers/of/gpio.c
> +++ linux-2.6/drivers/of/gpio.c
> @@ -140,7 +140,7 @@ int of_gpio_simple_xlate(struct gpio_chi
>  	if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
>  		return -EINVAL;
>  
> -	if (gpiospec->args[0] > gc->ngpio)
> +	if (gpiospec->args[0] >= gc->ngpio)
>  		return -EINVAL;
>  
>  	if (flags)

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.

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

end of thread, other threads:[~2012-04-07  3:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-04  0:02 [PATCH] gpio: Fix range check in of_gpio_simple_xlate() Roland Stigge
2012-04-04  0:11 ` Roland Stigge
2012-04-07  3:45 ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).