leds: lm36274: Put fwnode in error case during ->probe()
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Mon, 10 May 2021 09:50:33 +0000 (12:50 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:39 +0000 (16:56 +0200)
commitc54ad49e2ff7ac04ead4693b928df1332d9a6a59
tree9f37fbdf87c6a1c9a6ddd3eaef78618191ac2c0e
parent1ed913317166d117640252c299f8132ded3bc10d
leds: lm36274: Put fwnode in error case during ->probe()

[ Upstream commit 3c5f655c44bb65cb7e3c219d08c130ce5fa45d7f ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/leds/leds-lm36274.c