Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: e1c6edcbea13 ("leds: rt8515: Add Richtek RT8515 LED driver")
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Andy Shevchenko and committed by
Pavel Machek
8aa41952 7e1baaaa

+3 -1
+3 -1
drivers/leds/flash/leds-rt8515.c
··· 343 343 344 344 ret = devm_led_classdev_flash_register_ext(dev, fled, &init_data); 345 345 if (ret) { 346 - dev_err(dev, "can't register LED %s\n", led->name); 346 + fwnode_handle_put(child); 347 347 mutex_destroy(&rt->lock); 348 + dev_err(dev, "can't register LED %s\n", led->name); 348 349 return ret; 349 350 } 350 351 ··· 363 362 */ 364 363 } 365 364 365 + fwnode_handle_put(child); 366 366 return 0; 367 367 } 368 368