summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-03-07 13:55:15 +0800
committerEric Miao <eric.y.miao@gmail.com>2011-03-17 18:16:12 +0800
commit8aad172e6c54c74b1effe88ded2f308db3e1b658 (patch)
tree9cde71aa6b2e6366dbcea19ae1b3bb6930a96e00 /arch/arm/mach-pxa
parente3b1ceedf7adc4adfc989ee78a30fca7b62480b5 (diff)
downloadlinux-8aad172e6c54c74b1effe88ded2f308db3e1b658.tar.gz
linux-8aad172e6c54c74b1effe88ded2f308db3e1b658.tar.bz2
linux-8aad172e6c54c74b1effe88ded2f308db3e1b658.zip
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 <axel.lin@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/am200epd.c4
1 files changed, 2 insertions, 2 deletions
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;
}