[PATCH] watchdog: stm32_iwdg: use managed variant of dev_pm_set_wake_irq()

Guenter Roeck linux at roeck-us.net
Mon Nov 16 12:36:15 PST 2026


On Mon, Nov 16, 2026 at 08:01:30PM +0100, Antonio Borneo wrote:
> On probe failure after stm32_iwdg_irq_init() or on driver unbind,
> the struct wake_irq allocated by dev_pm_set_wake_irq() is leaked
> and dev->power.wakeirq remains attached to the device.
> Any subsequent attempt to re-probe the device hits the
> dev->power.wakeirq check in dev_pm_attach_wake_irq(), triggers a
> dev_WARN_ONCE() splat, and fails probe with -EEXIST.
> 
> Use the managed version devm_pm_set_wake_irq().
> 
> This is reported by Sashiko inside the raw log of another commit
> that touches the same driver.
> 
> Fixes: 3ab1663af6c1 ("watchdog: stm32_iwdg: Add pretimeout support")
> Reported-by: Sashiko <sashiko-bot at kernel.org>
> Link: https://sashiko.dev/#/message/20261116132416.1184447-3-antonio.borneo%40foss.st.com
> Link: https://sashiko.dev/#/log/249869
> Signed-off-by: Antonio Borneo <antonio.borneo at foss.st.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/watchdog/stm32_iwdg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
> 
> diff --git a/drivers/watchdog/stm32_iwdg.c b/drivers/watchdog/stm32_iwdg.c
> index a8d2db2d3cf8b..f1056f8100cf0 100644
> --- a/drivers/watchdog/stm32_iwdg.c
> +++ b/drivers/watchdog/stm32_iwdg.c
> @@ -298,7 +298,7 @@ static int stm32_iwdg_irq_init(struct platform_device *pdev,
>  		if (ret)
>  			return ret;
>  
> -		ret = dev_pm_set_wake_irq(dev, irq);
> +		ret = devm_pm_set_wake_irq(dev, irq);
>  		if (ret)
>  			return ret;
>  	}



More information about the linux-arm-kernel mailing list