From: Axel Lin Date: Mon, 7 Mar 2011 05:55:15 +0000 (+0800) Subject: ARM: pxa/am200epd: fix leak in am200_init_gpio_regs error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8aad172e6c54c74b1effe88ded2f308db3e1b658;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git ARM: pxa/am200epd: fix leak in am200_init_gpio_regs error path If gpio_request fails when i > 0, gpios[0] is not freed in current implementation. Signed-off-by: Axel Lin Signed-off-by: Eric Miao --- diff --git a/arch/arm/mach-pxa/am200epd.c b/arch/arm/mach-pxa/am200epd.c index 10964e376009..4cb069fd9af2 100644 --- a/arch/arm/mach-pxa/am200epd.c +++ b/arch/arm/mach-pxa/am200epd.c @@ -128,8 +128,8 @@ static int am200_init_gpio_regs(struct metronomefb_par *par) return 0; err_req_gpio: - while (i > 0) - gpio_free(gpios[i--]); + while (--i >= 0) + gpio_free(gpios[i]); return err; }