watchdog: stm32: Fix wakeup source leaks on device unbind
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 6 Apr 2025 20:35:30 +0000 (22:35 +0200)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sat, 24 May 2025 14:57:53 +0000 (16:57 +0200)
Device can be unbound or probe can fail, so driver must also release
memory for the wakeup source.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20250406203531.61322-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/stm32_iwdg.c

index 8ad06b54c5adc6c4aac5f98a95703e0e1ed06947..b356a272ff9a0ab3eac88782644391b40f6c7cdc 100644 (file)
@@ -291,7 +291,7 @@ static int stm32_iwdg_irq_init(struct platform_device *pdev,
                return 0;
 
        if (of_property_read_bool(np, "wakeup-source")) {
-               ret = device_init_wakeup(dev, true);
+               ret = devm_device_init_wakeup(dev);
                if (ret)
                        return ret;