summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorGUO Zihua <guozihua@huawei.com>2022-11-22 11:50:46 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-14 12:16:11 +0300
commit57ce1a36c060e480e1b2be82c4e27fb56619326c (patch)
tree139a796fa7fe12326075f606fd6e67a2f305d1db /drivers/rtc
parent1e2a27dab1e5aefeeff963ace5ffb066ebf82a20 (diff)
downloadlinux-57ce1a36c060e480e1b2be82c4e27fb56619326c.tar.xz
rtc: mxc_v2: Add missing clk_disable_unprepare()
[ Upstream commit 55d5a86618d3b1a768bce01882b74cbbd2651975 ] 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") Signed-off-by: GUO Zihua <guozihua@huawei.com> Link: https://lore.kernel.org/r/20221122085046.21689-1-guozihua@huawei.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-mxc_v2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-mxc_v2.c b/drivers/rtc/rtc-mxc_v2.c
index d349cef09cb7..48595b00ebb3 100644
--- a/drivers/rtc/rtc-mxc_v2.c
+++ b/drivers/rtc/rtc-mxc_v2.c
@@ -337,8 +337,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;