Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2da6877f authored by Andreas Platschek's avatar Andreas Platschek Committed by Alexandre Belloni
Browse files

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: default avatarAndreas Platschek <andreas.platschek@opentech.at>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent 994ec64c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -753,8 +753,10 @@ static int omap_rtc_probe(struct platform_device *pdev)

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	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);
	}

	platform_set_drvdata(pdev, rtc);

@@ -887,6 +889,7 @@ static int omap_rtc_probe(struct platform_device *pdev)
	return 0;

err:
	clk_disable_unprepare(rtc->clk);
	device_init_wakeup(&pdev->dev, false);
	rtc->type->lock(rtc);
	pm_runtime_put_sync(&pdev->dev);