Commit 55d5a866 authored by GUO Zihua's avatar GUO Zihua Committed by Alexandre Belloni

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: 5490a1e0 ("rtc: mxc_v2: fix possible race condition")
Signed-off-by: default avatarGUO Zihua <guozihua@huawei.com>
Link: https://lore.kernel.org/r/20221122085046.21689-1-guozihua@huawei.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 3bb23f1f
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment