[PATCH v2] rtc: stm32: fix clock leak on pinctrl probe failure

Linus Walleij linusw at kernel.org
Wed Sep 30 06:27:59 PDT 2026


On Fri, Sep 18, 2026 at 11:59 AM Cong Nguyen <congnt264 at gmail.com> wrote:

> A failing devm_pinctrl_register_and_init() or pinctrl_enable() in
> stm32_rtc_probe() returns directly instead of going through err:,
> leaking rtc_ck/pclk -- and since -EPROBE_DEFER is routine here, each
> deferred retry leaks another.
>
> Route both through err:, and move the pinctrl setup earlier (right
> after stm32_rtc_init(), before the RTC device/IRQ are registered) so
> disabling the clocks there doesn't race a still-live IRQ.
>
> Fixes: 16ad2bc09efb ("rtc: stm32: add pinctrl and pinmux interfaces")
> Reported-by: Sashiko AI review <sashiko-bot at kernel.org>
> Link: https://lore.kernel.org/r/20260914135401.373D91F000FF@smtp.kernel.org
> Assisted-by: LLM
> Signed-off-by: Cong Nguyen <congnt264 at gmail.com>

Reviewed-by: Linus Walleij <linusw at kernel.org>

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list