Skip to contentSkip to conversation

rtc: mxc_v2: Add missing clk_disable_unprepare()

PATCH Applied GUO Zihua 2 participants 2 messages Nov 22, 2022 – Dec 14, 2022

Subsystems (2)
lore
Share & tools
lore

GUO Zihua

author
#0 lore raw

PATCH 1/1 rtc: mxc_v2: Add missing clk_disable_unprepare()

The call to clk_disable_unprepare() is left out in the error handling of devm_rtc_allocate_device. Add it back.

Fixes 5490a1e018a4 ("rtc: mxc_v2: fix possible race condition")
---
 drivers/rtc/rtc-mxc_v2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/rtc/rtc-mxc_v2.c +3 -1
index 5e0383401629..f6d2ad91ff7a 100644
@@ -336,8 +336,10 @@ static int mxc_rtc_probe(struct platform_device *pdev)
 	}
 
 	pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
-	if (IS_ERR(pdata->rtc))
+	if (IS_ERR(pdata->rtc)) {
+		clk_disable_unprepare(pdata->clk);
 		return PTR_ERR(pdata->rtc);
+	}
 
 	pdata->rtc->ops = &mxc_rtc_ops;
 	pdata->rtc->range_max = U32_MAX;
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 4 lines · GUO Zihua

The call to clk_disable_unprepare() is left out in the error handling of devm_rtc_allocate_device. Add it back.

Applied, thanks!

[1/1] rtc: mxc_v2: Add missing clk_disable_unprepare()

      commit: 5c1a0939b53b97ac090a82b9527160a5effbca87

Best regards,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com