Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8aad172e authored by Axel Lin's avatar Axel Lin Committed by Eric Miao
Browse files

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: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent e3b1ceed
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
}