From: Gaosheng Cui Date: Wed, 23 Nov 2022 01:48:05 +0000 (+0800) Subject: rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe() X-Git-Tag: v6.6.17~5878^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5fb733d7bd6949e90028efdce8bd528c6ab7cf1e;p=platform%2Fkernel%2Flinux-rpi.git rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe() The clk_disable_unprepare() should be called in the error handling of clk_get_rate(), fix it. Fixes: b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC") Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20221123014805.1993052-1-cuigaosheng1@huawei.com Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c index bdb20f6..0f8e423 100644 --- a/drivers/rtc/rtc-st-lpc.c +++ b/drivers/rtc/rtc-st-lpc.c @@ -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; }