linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] [ARM] am200epd: fix resource leak in am200_init_gpio_regs error path
@ 2011-03-07  5:55 Axel Lin
  2011-03-07  5:56 ` [PATCH 2/2] [ARM] am300epd: fix resource leak in am300_init_gpio_regs " Axel Lin
  2011-03-17 15:07 ` [PATCH 1/2] [ARM] am200epd: fix resource leak in am200_init_gpio_regs " Eric Miao
  0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2011-03-07  5:55 UTC (permalink / raw)
  To: linux-arm-kernel

If gpio_request fails when i > 0, gpios[0] is not freed in current
implementation.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 arch/arm/mach-pxa/am200epd.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/am200epd.c b/arch/arm/mach-pxa/am200epd.c
index 3499fad..811d797 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;
 }
-- 
1.7.2

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

end of thread, other threads:[~2011-03-17 15:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-07  5:55 [PATCH 1/2] [ARM] am200epd: fix resource leak in am200_init_gpio_regs error path Axel Lin
2011-03-07  5:56 ` [PATCH 2/2] [ARM] am300epd: fix resource leak in am300_init_gpio_regs " Axel Lin
2011-03-17 15:06   ` Eric Miao
2011-03-17 15:07 ` [PATCH 1/2] [ARM] am200epd: fix resource leak in am200_init_gpio_regs " Eric Miao

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).