Skip to content

Commit

Permalink
ARM: pxa/am200epd: fix leak in am200_init_gpio_regs error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Eric Miao committed Mar 17, 2011
1 parent e3b1cee commit 8aad172
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-pxa/am200epd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8aad172

Please sign in to comment.