Thread (9 messages) flat view 9 messages, 2 authors, 2021-01-11

Re: [PATCH v4 2/3] rtc: s5m: check the return value of s5m8767_rtc_init_reg()

From: Bartosz Golaszewski <hidden>
Date: 2021-01-11 14:12:41
Also in: linux-samsung-soc, lkml

On Mon, Jan 11, 2021 at 2:35 PM Krzysztof Kozlowski [off-list ref] wrote:
On Mon, Jan 11, 2021 at 01:40:26PM +0100, Bartosz Golaszewski wrote:
quoted
From: Bartosz Golaszewski <redacted>

This function can fail if regmap operations fail so check its return
value in probe().

Signed-off-by: Bartosz Golaszewski <redacted>
---
 drivers/rtc/rtc-s5m.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index eb9dde4095a9..e0011d3cf61b 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -791,6 +791,8 @@ static int s5m_rtc_probe(struct platform_device *pdev)
      platform_set_drvdata(pdev, info);

      ret = s5m8767_rtc_init_reg(info);
+     if (ret)
+             return ret;
You leak I2C device.
Yes, the next patch fixes it but I changed the order. Actually this
can be moved after 3/3 with no conflicts when applying.

Bartosz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help