Skip to content

Commit 950b9a9

Browse files
andy-shevKelsey Skunberg
authored andcommitted
leds: lt3593: Put fwnode in any case during ->probe()
BugLink: https://bugs.launchpad.net/bugs/1946024 [ Upstream commit 7e1baaa ] 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 <daniel@zonque.org> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
1 parent 7ec1701 commit 950b9a9

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/leds/leds-lt3593.c

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

105105
ret = devm_led_classdev_register_ext(dev, &led_data->cdev, &init_data);
106-
if (ret < 0) {
107-
fwnode_handle_put(child);
106+
fwnode_handle_put(child);
107+
if (ret < 0)
108108
return ret;
109-
}
110109

111110
led_data->cdev.dev->of_node = dev->of_node;
112111
platform_set_drvdata(pdev, led_data);

0 commit comments

Comments
 (0)