diff options
author | Tobias Jordan <kernel@cdqe.de> | 2020-09-26 02:51:17 +0200 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2020-09-30 19:20:46 +0200 |
commit | 108f4664e3449828114780a05393eb8d2be7fdd0 (patch) | |
tree | 8a3cbae73ddbed7e71372492885a82a6c0f1c912 /drivers/leds | |
parent | 564ead1280d7590f0015d8225637d546e9fa94eb (diff) |
leds: tlc591xx: fix leak of device node iterator
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>
Reviewed-by: Marek BehĂșn <kabel@kernel.org>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-tlc591xx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c index f24271337bd8..5b9dfdf743ec 100644 --- a/drivers/leds/leds-tlc591xx.c +++ b/drivers/leds/leds-tlc591xx.c @@ -205,10 +205,12 @@ tlc591xx_probe(struct i2c_client *client, led->ldev.max_brightness = TLC591XX_MAX_BRIGHTNESS; err = devm_led_classdev_register_ext(dev, &led->ldev, &init_data); - if (err < 0) + if (err < 0) { + of_node_put(child); return dev_err_probe(dev, err, "couldn't register LED %s\n", led->ldev.name); + } } return 0; } |