[PATCH] pinctrl: sunxi: fix regulator leak in sunxi_pmx_request() error path
Linus Walleij
linusw at kernel.org
Tue May 5 02:26:12 PDT 2026
On Mon, May 4, 2026 at 4:53 PM Felix Gu <ustc.gu at 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 at gmail.com>
Patch applied as nonurgent fix!
Yours,
Linus Walleij
More information about the linux-arm-kernel
mailing list