提交 8aad172e 编写于 作者: A Axel Lin 提交者: Eric Miao

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: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NEric Miao <eric.y.miao@gmail.com>
上级 e3b1ceed
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册