[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180907210910.494820601@linuxfoundation.org>
Date: Fri, 7 Sep 2018 23:08:59 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
Johan Hovold <johan@...nel.org>,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Subject: [PATCH 4.18 073/145] rtc: omap: fix resource leak in registration error path
4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@...nel.org>
commit 551757eb052986ec81cebcc6301cc1c4f8dca938 upstream.
Make sure to deregister the pin controller in case rtc registration
fails.
Fixes: 57072758623f ("rtc: omap: switch to rtc_register_device")
Cc: stable <stable@...r.kernel.org> # 4.14
Cc: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
Signed-off-by: Johan Hovold <johan@...nel.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/rtc/rtc-omap.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -880,12 +880,14 @@ static int omap_rtc_probe(struct platfor
ret = rtc_register_device(rtc->rtc);
if (ret)
- goto err;
+ goto err_deregister_pinctrl;
rtc_nvmem_register(rtc->rtc, &omap_rtc_nvmem_config);
return 0;
+err_deregister_pinctrl:
+ pinctrl_unregister(rtc->pctldev);
err:
clk_disable_unprepare(rtc->clk);
device_init_wakeup(&pdev->dev, false);
Powered by blists - more mailing lists