Current implementation of as3722_rtc_probe() leaves wakeup enabled on the error path of .probe(), which results in a memory leak. Fix it by adding device_init_wakeup(&pdev->dev, false) calls. Fixes: b45062619840 ("drivers/rtc/rtc-as3722: add RTC driver") Signed-off-by: Joe Hattori <joe@xxxxxxxxxxxxxxxxxxxxx> --- drivers/rtc/rtc-as3722.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/rtc/rtc-as3722.c b/drivers/rtc/rtc-as3722.c index 0f21af27f4cf..558829e17643 100644 --- a/drivers/rtc/rtc-as3722.c +++ b/drivers/rtc/rtc-as3722.c @@ -194,6 +194,7 @@ static int as3722_rtc_probe(struct platform_device *pdev) if (IS_ERR(as3722_rtc->rtc)) { ret = PTR_ERR(as3722_rtc->rtc); dev_err(&pdev->dev, "RTC register failed: %d\n", ret); + device_init_wakeup(&pdev->dev, false); return ret; } @@ -206,6 +207,7 @@ static int as3722_rtc_probe(struct platform_device *pdev) if (ret < 0) { dev_err(&pdev->dev, "Failed to request alarm IRQ %d: %d\n", as3722_rtc->alarm_irq, ret); + device_init_wakeup(&pdev->dev, false); return ret; } disable_irq(as3722_rtc->alarm_irq); -- 2.34.1