提交 2da6877f 编写于 作者: A Andreas Platschek 提交者: Alexandre Belloni

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: NAndreas Platschek <andreas.platschek@opentech.at>
Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
上级 994ec64c
...@@ -753,8 +753,10 @@ static int omap_rtc_probe(struct platform_device *pdev) ...@@ -753,8 +753,10 @@ static int omap_rtc_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
rtc->base = devm_ioremap_resource(&pdev->dev, res); rtc->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(rtc->base)) if (IS_ERR(rtc->base)) {
clk_disable_unprepare(rtc->clk);
return PTR_ERR(rtc->base); return PTR_ERR(rtc->base);
}
platform_set_drvdata(pdev, rtc); platform_set_drvdata(pdev, rtc);
...@@ -887,6 +889,7 @@ static int omap_rtc_probe(struct platform_device *pdev) ...@@ -887,6 +889,7 @@ static int omap_rtc_probe(struct platform_device *pdev)
return 0; return 0;
err: err:
clk_disable_unprepare(rtc->clk);
device_init_wakeup(&pdev->dev, false); device_init_wakeup(&pdev->dev, false);
rtc->type->lock(rtc); rtc->type->lock(rtc);
pm_runtime_put_sync(&pdev->dev); pm_runtime_put_sync(&pdev->dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册