mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] leds: tlc591xx: fix leak of device node iterator
@ 2020-09-25 23:10 Tobias Jordan
  2020-09-25 23:17 ` Marek Behun
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Jordan @ 2020-09-25 23:10 UTC (permalink / raw)
  To: linux-leds, linux-kernel
  Cc: Pavel Machek, Dan Murphy, Jean-Jacques Hiblot, Tomi Valkeinen

In one of the error paths of the for_each_child_of_node loop in
tlc591xx_probe, add missing call to of_node_put.

Fixes: 1ab4531ad132 ("leds: tlc591xx: simplify driver by using the
managed led API")

Signed-off-by: Tobias Jordan <kernel@cdqe.de>
---
 drivers/leds/leds-tlc591xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c
index 0929f1275814..a8cc49752cd5 100644
--- a/drivers/leds/leds-tlc591xx.c
+++ b/drivers/leds/leds-tlc591xx.c
@@ -214,6 +214,7 @@ tlc591xx_probe(struct i2c_client *client,
 		err = devm_led_classdev_register_ext(dev, &led->ldev,
 						     &init_data);
 		if (err < 0) {
+			of_node_put(child);
 			if (err != -EPROBE_DEFER)
 				dev_err(dev, "couldn't register LED %s\n",
 					led->ldev.name);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-25 23:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 23:10 [PATCH] leds: tlc591xx: fix leak of device node iterator Tobias Jordan
2020-09-25 23:17 ` Marek Behun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®