diff options
author | Andreas Platschek <andreas.platschek@opentech.at> | 2017-12-06 14:42:38 -0500 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2017-12-18 17:05:11 -0500 |
commit | 2da6877f0e2ced7825a31556ada6b2ac2e50877f (patch) | |
tree | d9d4fcc54cd408afc583d1a93c8b0fdcc14c974e | |
parent | 994ec64c0a193940be7a6fd074668b9446d3b6c3 (diff) |
rtc: omap: fix unbalanced clk_prepare_enable/clk_disable_unprepare
There are 2 error paths after clk_prepare_enable() was called, where
clk_disable_unprepare() is missing.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Andreas Platschek <andreas.platschek@opentech.at>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
-rw-r--r-- | drivers/rtc/rtc-omap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index 1d666ac9ef70..09ef802d6e54 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c | |||
@@ -753,8 +753,10 @@ static int omap_rtc_probe(struct platform_device *pdev) | |||
753 | 753 | ||
754 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 754 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
755 | rtc->base = devm_ioremap_resource(&pdev->dev, res); | 755 | rtc->base = devm_ioremap_resource(&pdev->dev, res); |
756 | if (IS_ERR(rtc->base)) | 756 | if (IS_ERR(rtc->base)) { |
757 | clk_disable_unprepare(rtc->clk); | ||
757 | return PTR_ERR(rtc->base); | 758 | return PTR_ERR(rtc->base); |
759 | } | ||
758 | 760 | ||
759 | platform_set_drvdata(pdev, rtc); | 761 | platform_set_drvdata(pdev, rtc); |
760 | 762 | ||
@@ -887,6 +889,7 @@ static int omap_rtc_probe(struct platform_device *pdev) | |||
887 | return 0; | 889 | return 0; |
888 | 890 | ||
889 | err: | 891 | err: |
892 | clk_disable_unprepare(rtc->clk); | ||
890 | device_init_wakeup(&pdev->dev, false); | 893 | device_init_wakeup(&pdev->dev, false); |
891 | rtc->type->lock(rtc); | 894 | rtc->type->lock(rtc); |
892 | pm_runtime_put_sync(&pdev->dev); | 895 | pm_runtime_put_sync(&pdev->dev); |