Skip to contentSkip to conversation

rtc: mxc_v2: fix wake IRQ leak on probe failure and remove()

PATCH In review Cong Nguyen 3 participants 3 messages Sep 18

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: mxc_v2: fix wake IRQ leak on probe failure and remove()

dev_pm_set_wake_irq() in probe has no matching dev_pm_clear_wake_irq() anywhere -- not on later probe-failure paths, not in remove(). Switch to devm_pm_set_wake_irq(), which registers the clear automatically on every exit path.

Fixes fbc5ee9a6955 ("rtc: mxc_v2: use dev_pm_set_wake_irq() to simplify code")
Assisted-by LLM
---
 drivers/rtc/rtc-mxc_v2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-mxc_v2.c +1 -1
index a07acbbcfaeb..7080aaf9ffa0 100644
@@ -302,7 +302,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
 		return pdata->irq;
 
 	device_init_wakeup(&pdev->dev, true);
-	ret = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
+	ret = devm_pm_set_wake_irq(&pdev->dev, pdata->irq);
 	if (ret)
 		dev_err(&pdev->dev, "failed to enable irq wake\n");
 
Signature · 1 line
2.25.1
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 10 lines

dev_pm_set_wake_irq() in probe has no matching dev_pm_clear_wake_irq() anywhere -- not on later probe-failure paths, not in remove(). Switch to devm_pm_set_wake_irq(), which registers the clear automatically on every exit path.

Fixes fbc5ee9a6955 ("rtc: mxc_v2: use dev_pm_set_wake_irq() to simplify code")
Assisted-by LLM

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Cong Nguyen
Quoted 7 lines · Cong Nguyen

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

dev_pm_set_wake_irq() in probe has no matching dev_pm_clear_wake_irq() anywhere -- not on later probe-failure paths, not in remove(). Switch to devm_pm_set_wake_irq(), which registers the clear automatically on every exit path.

Quoted 6 lines
Fixes fbc5ee9a6955 ("rtc: mxc_v2: use dev_pm_set_wake_irq() to simplify code")
Assisted-by LLM

---

Quoted 20 lines
 drivers/rtc/rtc-mxc_v2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-mxc_v2.c +1 -2
index a07acbbcfaeb..7080aaf9ffa0 100644
@@ -302,7 +302,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
                return pdata->irq;
 
        device_init_wakeup(&pdev->dev, true);
-       ret = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
+       ret = devm_pm_set_wake_irq(&pdev->dev, pdata->irq);
        if (ret)
                dev_err(&pdev->dev, "failed to enable irq wake\n");
 
--

2.25.1