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

Cong Nguyen posted 1 patch 6 days, 7 hours ago
drivers/rtc/rtc-mxc_v2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] rtc: mxc_v2: fix wake IRQ leak on probe failure and remove()
Posted by Cong Nguyen 6 days, 7 hours ago
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")
Reported-by: Sashiko AI review <sashiko-bot@kernel.org>
Link: https://lore.kernel.org/r/20260914134826.EC26D1F000FF@smtp.kernel.org
Assisted-by: LLM
Signed-off-by: Cong Nguyen <congnt264@gmail.com>
---
 drivers/rtc/rtc-mxc_v2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c
index a07acbbcfaeb..7080aaf9ffa0 100644
--- a/drivers/rtc/rtc-mxc_v2.c
+++ b/drivers/rtc/rtc-mxc_v2.c
@@ -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
Re: [PATCH] rtc: mxc_v2: fix wake IRQ leak on probe failure and remove()
Posted by Frank Li 6 days, 3 hours ago
On Fri, Sep 18, 2026 at 10:54:29PM +0700, Cong Nguyen wrote:
> [You don't often get email from congnt264@gmail.com. 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.
>
> Fixes: fbc5ee9a6955 ("rtc: mxc_v2: use dev_pm_set_wake_irq() to simplify code")
> Reported-by: Sashiko AI review <sashiko-bot@kernel.org>
> Link: https://lore.kernel.org/r/20260914134826.EC26D1F000FF@smtp.kernel.org
> Assisted-by: LLM
> Signed-off-by: Cong Nguyen <congnt264@gmail.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/rtc/rtc-mxc_v2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c
> index a07acbbcfaeb..7080aaf9ffa0 100644
> --- a/drivers/rtc/rtc-mxc_v2.c
> +++ b/drivers/rtc/rtc-mxc_v2.c
> @@ -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
>
>