Commit 551757eb authored by Johan Hovold's avatar Johan Hovold Committed by Alexandre Belloni

rtc: omap: fix resource leak in registration error path

Make sure to deregister the pin controller in case rtc registration
fails.

Fixes: 57072758 ("rtc: omap: switch to rtc_register_device")
Cc: stable <stable@vger.kernel.org>     # 4.14
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 5c8b84f4
...@@ -873,7 +873,7 @@ static int omap_rtc_probe(struct platform_device *pdev) ...@@ -873,7 +873,7 @@ static int omap_rtc_probe(struct platform_device *pdev)
ret = rtc_register_device(rtc->rtc); ret = rtc_register_device(rtc->rtc);
if (ret) if (ret)
goto err; goto err_deregister_pinctrl;
rtc_nvmem_register(rtc->rtc, &omap_rtc_nvmem_config); rtc_nvmem_register(rtc->rtc, &omap_rtc_nvmem_config);
...@@ -886,6 +886,8 @@ static int omap_rtc_probe(struct platform_device *pdev) ...@@ -886,6 +886,8 @@ static int omap_rtc_probe(struct platform_device *pdev)
return 0; return 0;
err_deregister_pinctrl:
pinctrl_unregister(rtc->pctldev);
err: err:
clk_disable_unprepare(rtc->clk); clk_disable_unprepare(rtc->clk);
device_init_wakeup(&pdev->dev, false); device_init_wakeup(&pdev->dev, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment