Re: [PATCH] pinctrl: stm32: Fix clock reference leak in stm32_pctl_probe()
From: Linus Walleij
Date: Wed Sep 30 2026 - 09:40:14 EST
On Thu, Sep 17, 2026 at 3:50 PM Wentao Liang <vulab@xxxxxxxxxxx> wrote:
> stm32_pctl_probe() obtains one clock per bank with
> of_clk_get_by_name(), but none of the error paths drop those
> references: the loop returns directly when a later clock lookup fails,
> and both the clk_bulk_prepare_enable() failure and the err_register
> path return without calling clk_bulk_put(). clk_bulk_disable_unprepare()
> only disables the clocks, it does not release them.
>
> Release the references on these paths; the success path keeps them as
> the driver needs them for suspend/resume.
>
> Fixes: 451bc9aea9a1 ("pinctrl: stm32: Add check for clk_enable()")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
Patch applied w/o stale tag.
Yours,
Linus Walleij