Re: [PATCH] gpio: Fix range check in of_gpio_simple_xlate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Wed,  4 Apr 2012 02:02:58 +0200, Roland Stigge <stigge@xxxxxxxxx> 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@xxxxxxxxx>

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.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


[Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [PDAs]     [Linux]     [Linux MIPS]     [Yosemite Campsites]     [Photos]

Add to Google Follow linuxarm on Twitter