[PATCH] pinctrl: stm32: fix hwspinlock resource leak in probe function

Linus Walleij linus.walleij at linaro.org
Wed Oct 29 15:38:01 PDT 2025


On Wed, Oct 29, 2025 at 2:43 AM Haotian Zhang <vulab at iscas.ac.cn> wrote:

> In stm32_pctl_probe(), hwspin_lock_request_specific() is called to
> request a hwspinlock, but the acquired lock is not freed on multiple
> error paths after this call. This causes resource leakage when the
> function fails to initialize properly.
>
> Use devm_hwspin_lock_request_specific() instead of
> hwspin_lock_request_specific() to automatically manage the hwspinlock
> resource lifecycle.
>
> Fixes: 97cfb6cd34f2 ("pinctrl: stm32: protect configuration registers with a hwspinlock")
> Signed-off-by: Haotian Zhang <vulab at iscas.ac.cn>

Patch applied!

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list