* [PATCH] rtc: pl031: fix resource leak in pl031_probe
@ 2020-11-12 9:31 Zheng Liang
2020-11-12 12:01 ` Linus Walleij
2020-11-14 22:43 ` Alexandre Belloni
0 siblings, 2 replies; 3+ messages in thread
From: Zheng Liang @ 2020-11-12 9:31 UTC (permalink / raw
To: linus.walleij
Cc: a.zummo, alexandre.belloni, linux-arm-kernel, linux-rtc, wangli74,
fangwei1, zhengliang6
When devm_rtc_allocate_device is failed in pl031_probe, it should release
mem regions with device.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zheng Liang <zhengliang6@huawei.com>
---
drivers/rtc/rtc-pl031.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index c6b89273feba..d4b2ab786126 100644
--- a/drivers/rtc/rtc-pl031.c
+++ b/drivers/rtc/rtc-pl031.c
@@ -361,8 +361,10 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
device_init_wakeup(&adev->dev, true);
ldata->rtc = devm_rtc_allocate_device(&adev->dev);
- if (IS_ERR(ldata->rtc))
- return PTR_ERR(ldata->rtc);
+ if (IS_ERR(ldata->rtc)) {
+ ret = PTR_ERR(ldata->rtc);
+ goto out;
+ }
ldata->rtc->ops = ops;
ldata->rtc->range_min = vendor->range_min;
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rtc: pl031: fix resource leak in pl031_probe
2020-11-12 9:31 [PATCH] rtc: pl031: fix resource leak in pl031_probe Zheng Liang
@ 2020-11-12 12:01 ` Linus Walleij
2020-11-14 22:43 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2020-11-12 12:01 UTC (permalink / raw
To: Zheng Liang
Cc: Alessandro Zummo, Alexandre Belloni, Linux ARM, linux-rtc,
wangli74, fangwei1
On Thu, Nov 12, 2020 at 9:34 AM Zheng Liang <zhengliang6@huawei.com> wrote:
> When devm_rtc_allocate_device is failed in pl031_probe, it should release
> mem regions with device.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zheng Liang <zhengliang6@huawei.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rtc: pl031: fix resource leak in pl031_probe
2020-11-12 9:31 [PATCH] rtc: pl031: fix resource leak in pl031_probe Zheng Liang
2020-11-12 12:01 ` Linus Walleij
@ 2020-11-14 22:43 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2020-11-14 22:43 UTC (permalink / raw
To: Zheng Liang, linus.walleij
Cc: Alexandre Belloni, fangwei1, a.zummo, linux-rtc, linux-arm-kernel,
wangli74
On Thu, 12 Nov 2020 17:31:39 +0800, Zheng Liang wrote:
> When devm_rtc_allocate_device is failed in pl031_probe, it should release
> mem regions with device.
Applied, thanks!
[1/1] rtc: pl031: fix resource leak in pl031_probe
commit: 1eab0fea2514b269e384c117f5b5772b882761f0
Best regards,
--
Alexandre Belloni <alexandre.belloni@bootlin.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-14 22:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-12 9:31 [PATCH] rtc: pl031: fix resource leak in pl031_probe Zheng Liang
2020-11-12 12:01 ` Linus Walleij
2020-11-14 22:43 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).