Commit 7e1baaaa authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Pavel Machek
Browse files

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: 8cd7d6da ("leds: lt3593: Add device tree probing glue")
Cc: Daniel Mack <daniel@zonque.org>
Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
parent d299ae94
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -97,10 +97,9 @@ static int lt3593_led_probe(struct platform_device *pdev)
	init_data.default_label = ":";

	ret = devm_led_classdev_register_ext(dev, &led_data->cdev, &init_data);
	if (ret < 0) {
	fwnode_handle_put(child);
	if (ret < 0)
		return ret;
	}

	platform_set_drvdata(pdev, led_data);