Commit 8aa41952 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Pavel Machek

leds: rt8515: Put fwnode in any case during ->probe()

fwnode_get_next_available_child_node() bumps a reference counting of
a returned variable. We have to balance it whenever we return to
the caller.

Fixes: e1c6edcb ("leds: rt8515: Add Richtek RT8515 LED driver")
Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 7e1baaaa
......@@ -343,8 +343,9 @@ static int rt8515_probe(struct platform_device *pdev)
ret = devm_led_classdev_flash_register_ext(dev, fled, &init_data);
if (ret) {
dev_err(dev, "can't register LED %s\n", led->name);
fwnode_handle_put(child);
mutex_destroy(&rt->lock);
dev_err(dev, "can't register LED %s\n", led->name);
return ret;
}
......@@ -362,6 +363,7 @@ static int rt8515_probe(struct platform_device *pdev)
*/
}
fwnode_handle_put(child);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment