This is a note to let you know that I've just added the patch titled leds: lp50xx: Put fwnode in error case during ->probe() to the 5.13-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: leds-lp50xx-put-fwnode-in-error-case-during-probe.patch and it can be found in the queue-5.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 87ee6cca6a5bb7d5196ba0f82639bd78563a3bc0 Author: Andy Shevchenko <andy.shevchenko@xxxxxxxxx> Date: Mon May 10 12:50:40 2021 +0300 leds: lp50xx: Put fwnode in error case during ->probe() [ Upstream commit f1e1d532da7e6ef355528a22fb97d9a8fbf76c4e ] fwnode_for_each_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller. OTOH, the successful iteration will drop reference count under the hood, no need to do it twice. Fixes: 242b81170fb8 ("leds: lp50xx: Add the LP50XX family of the RGB LED driver") Cc: Dan Murphy <dmurphy@xxxxxx> Signed-off-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx> Signed-off-by: Pavel Machek <pavel@xxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c index 06230614fdc5..401df1e2e05d 100644 --- a/drivers/leds/leds-lp50xx.c +++ b/drivers/leds/leds-lp50xx.c @@ -490,6 +490,7 @@ static int lp50xx_probe_dt(struct lp50xx *priv) ret = fwnode_property_read_u32(led_node, "color", &color_id); if (ret) { + fwnode_handle_put(led_node); dev_err(priv->dev, "Cannot read color\n"); goto child_out; } @@ -512,7 +513,6 @@ static int lp50xx_probe_dt(struct lp50xx *priv) goto child_out; } i++; - fwnode_handle_put(child); } return 0;