[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210913131050.404769959@linuxfoundation.org>
Date: Mon, 13 Sep 2021 15:14:14 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Daniel Mack <daniel@...que.org>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Pavel Machek <pavel@....cz>, Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.4 073/144] leds: lt3593: Put fwnode in any case during ->probe()
From: Andy Shevchenko <andy.shevchenko@...il.com>
[ Upstream commit 7e1baaaa2407a642ea19b58e214fab9a69cda1d7 ]
device_get_next_child_node() bumps a reference counting of a returned variable.
We have to balance it whenever we return to the caller.
Fixes: 8cd7d6daba93 ("leds: lt3593: Add device tree probing glue")
Cc: Daniel Mack <daniel@...que.org>
Signed-off-by: Andy Shevchenko <andy.shevchenko@...il.com>
Signed-off-by: Pavel Machek <pavel@....cz>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/leds/leds-lt3593.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/leds/leds-lt3593.c b/drivers/leds/leds-lt3593.c
index c94995f0daa2..03ae33093ce6 100644
--- a/drivers/leds/leds-lt3593.c
+++ b/drivers/leds/leds-lt3593.c
@@ -103,10 +103,9 @@ static int lt3593_led_probe(struct platform_device *pdev)
init_data.default_label = ":";
ret = devm_led_classdev_register_ext(dev, &led_data->cdev, &init_data);
- if (ret < 0) {
- fwnode_handle_put(child);
+ fwnode_handle_put(child);
+ if (ret < 0)
return ret;
- }
led_data->cdev.dev->of_node = dev->of_node;
platform_set_drvdata(pdev, led_data);
--
2.30.2
Powered by blists - more mailing lists