Skip to content

Commit 108f466

Browse files
Tobias Jordanpavelmachek
authored andcommitted
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: 1ab4531 ("leds: tlc591xx: simplify driver by using the managed led API") Signed-off-by: Tobias Jordan <[email protected]> Reviewed-by: Marek Behún <[email protected]> Reviewed-by: Tomi Valkeinen <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
1 parent 564ead1 commit 108f466

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/leds/leds-tlc591xx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,12 @@ tlc591xx_probe(struct i2c_client *client,
205205
led->ldev.max_brightness = TLC591XX_MAX_BRIGHTNESS;
206206
err = devm_led_classdev_register_ext(dev, &led->ldev,
207207
&init_data);
208-
if (err < 0)
208+
if (err < 0) {
209+
of_node_put(child);
209210
return dev_err_probe(dev, err,
210211
"couldn't register LED %s\n",
211212
led->ldev.name);
213+
}
212214
}
213215
return 0;
214216
}

0 commit comments

Comments
 (0)