Skip to content

Commit 7e1baaa

Browse files
andy-shevpavelmachek
authored andcommitted
leds: lt3593: Put fwnode in any case during ->probe()
device_get_next_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller. Fixes: 8cd7d6d ("leds: lt3593: Add device tree probing glue") Cc: Daniel Mack <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
1 parent d299ae9 commit 7e1baaa

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/leds/leds-lt3593.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,9 @@ static int lt3593_led_probe(struct platform_device *pdev)
9797
init_data.default_label = ":";
9898

9999
ret = devm_led_classdev_register_ext(dev, &led_data->cdev, &init_data);
100-
if (ret < 0) {
101-
fwnode_handle_put(child);
100+
fwnode_handle_put(child);
101+
if (ret < 0)
102102
return ret;
103-
}
104103

105104
platform_set_drvdata(pdev, led_data);
106105

0 commit comments

Comments
 (0)