[PATCH] arm: ep93xx: Don't try to release not acquired GPIO lines

H Hartley Sweeten hartleys at visionengravers.com
Thu Apr 5 12:39:31 EDT 2012


On Thursday, April 05, 2012 4:44 AM, Rafal Prylowski wrote:
> Fail path of ep93xx_keypad_acquire_gpio() tries to release
> GPIO lines not acquired successfully before. Fix this.
>
> Signed-off-by: Rafal Prylowski <prylowski at metasoft.pl>
> Cc: H Hartley Sweeten <hsweeten at visionengravers.com>
> Cc: Ryan Mallon <rmallon at gmail.com>
>
> ---
> Patch applies to v3.4rc1.
>
>  arch/arm/mach-ep93xx/core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-2.6/arch/arm/mach-ep93xx/core.c
> ===================================================================
> --- linux-2.6.orig/arch/arm/mach-ep93xx/core.c
> +++ linux-2.6/arch/arm/mach-ep93xx/core.c
> @@ -734,7 +734,7 @@ int ep93xx_keypad_acquire_gpio(struct pl
>  fail_gpio_d:
>  	gpio_free(EP93XX_GPIO_LINE_C(i));
>  fail_gpio_c:
> -	for ( ; i >= 0; --i) {
> +	for (--i; i >= 0; --i) {
>  		gpio_free(EP93XX_GPIO_LINE_C(i));
>  		gpio_free(EP93XX_GPIO_LINE_D(i));
>  	}

Acked-by: H Hartley Sweeten <hsweeten at visionengravers.com>

Thanks!




More information about the linux-arm-kernel mailing list