Skip to content

Commit

Permalink
rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe()
Browse files Browse the repository at this point in the history
[ Upstream commit 5fb733d ]

The clk_disable_unprepare() should be called in the error handling
of clk_get_rate(), fix it.

Fixes: b5b2bdf ("rtc: st: Add new driver for ST's LPC RTC")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20221123014805.1993052-1-cuigaosheng1@huawei.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
gscui authored and gregkh committed Dec 31, 2022
1 parent 75b2692 commit abfa5dd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/rtc/rtc-st-lpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ static int st_rtc_probe(struct platform_device *pdev)

rtc->clkrate = clk_get_rate(rtc->clk);
if (!rtc->clkrate) {
clk_disable_unprepare(rtc->clk);
dev_err(&pdev->dev, "Unable to fetch clock rate\n");
return -EINVAL;
}
Expand Down

0 comments on commit abfa5dd

Please sign in to comment.