Messages in this thread |  | | From | Linus Walleij <> | | Date | Tue, 5 May 2026 11:26:12 +0200 | | Subject | Re: [PATCH] pinctrl: sunxi: fix regulator leak in sunxi_pmx_request() error path |
| |
On Mon, May 4, 2026 at 4:53 PM Felix Gu <ustc.gu@gmail.com> wrote:
> In the error path of sunxi_pmx_request(), the code calls > regulator_put(s_reg->regulator) to release the regulator. However, > s_reg->regulator is only assigned after a successful regulator_enable(). > This causes a memory leak: the regulator obtained via regulator_get() > is never properly released when regulator_enable() fails. > > Fixes: dc1445584177 ("pinctrl: sunxi: Fix and simplify pin bank regulator handling") > Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Patch applied as nonurgent fix!
Yours, Linus Walleij
|  |