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

leds: lm36274: Put fwnode in error 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.

In the older code the same is implied with device_for_each_child_node().

Fixes: 11e1bbc116a7 ("leds: lm36274: Introduce the TI LM36274 LED driver")
Fixes: a448fcf19c9c ("leds: lm36274: don't iterate through children since there is only one")
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Marek Behún <marek.behun@nic.cz>
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>

authored by

Andy Shevchenko and committed by
Pavel Machek
3c5f655c 2f39f68c

+1
+1
drivers/leds/leds-lm36274.c
··· 127 127 128 128 ret = lm36274_init(chip); 129 129 if (ret) { 130 + fwnode_handle_put(init_data.fwnode); 130 131 dev_err(chip->dev, "Failed to init the device\n"); 131 132 return ret; 132 133 }