rtc: mxc_v2: Add missing clk_disable_unprepare()

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2183349

commit 55d5a86618d3b1a768bce01882b74cbbd2651975
Author: GUO Zihua <guozihua@huawei.com>
Date:   Tue Nov 22 16:50:46 2022 +0800

    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: 5490a1e018 ("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>
    (cherry picked from commit 55d5a86618d3b1a768bce01882b74cbbd2651975)

Signed-off-by: Gavin Shan <gshan@redhat.com>
This commit is contained in:
Gavin Shan 2023-05-30 13:35:10 +10:00
parent c3fe7cdfd3
commit 51aaf719c2
1 changed files with 3 additions and 1 deletions

View File

@ -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;