Skip to content

Commit

Permalink
rtc: mxc_v2: Add missing clk_disable_unprepare()
Browse files Browse the repository at this point in the history
[ Upstream commit 55d5a86 ]

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

Fixes: 5490a1e ("rtc: mxc_v2: fix possible race condition")
Signed-off-by: GUO Zihua <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexandre Belloni <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
GUO Zihua authored and Sasha Levin committed Dec 27, 2022
1 parent e95889d commit 3120843
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/rtc/rtc-mxc_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3120843

Please sign in to comment.