Skip to content

Commit 8aa4195

Browse files
andy-shevpavelmachek
authored andcommitted
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: e1c6edc ("leds: rt8515: Add Richtek RT8515 LED driver") Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Pavel Machek <[email protected]> Reviewed-by: Linus Walleij <[email protected]>
1 parent 7e1baaa commit 8aa4195

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/leds/flash/leds-rt8515.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,9 @@ static int rt8515_probe(struct platform_device *pdev)
343343

344344
ret = devm_led_classdev_flash_register_ext(dev, fled, &init_data);
345345
if (ret) {
346-
dev_err(dev, "can't register LED %s\n", led->name);
346+
fwnode_handle_put(child);
347347
mutex_destroy(&rt->lock);
348+
dev_err(dev, "can't register LED %s\n", led->name);
348349
return ret;
349350
}
350351

@@ -362,6 +363,7 @@ static int rt8515_probe(struct platform_device *pdev)
362363
*/
363364
}
364365

366+
fwnode_handle_put(child);
365367
return 0;
366368
}
367369

0 commit comments

Comments
 (0)