[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210712060943.614183845@linuxfoundation.org>
Date: Mon, 12 Jul 2021 08:10:41 +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, Dan Murphy <dmurphy@...com>,
Marek BehĂșn <marek.behun@....cz>,
Andy Shevchenko <andy.shevchenko@...il.com>,
Pavel Machek <pavel@....cz>, Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.10 481/593] leds: lm36274: Put fwnode in error case during ->probe()
From: Andy Shevchenko <andy.shevchenko@...il.com>
[ 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@...com>
Cc: Marek BehĂșn <marek.behun@....cz>
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-lm36274.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/leds/leds-lm36274.c b/drivers/leds/leds-lm36274.c
index aadb03468a40..a23a9424c2f3 100644
--- a/drivers/leds/leds-lm36274.c
+++ b/drivers/leds/leds-lm36274.c
@@ -127,6 +127,7 @@ static int lm36274_probe(struct platform_device *pdev)
ret = lm36274_init(chip);
if (ret) {
+ fwnode_handle_put(init_data.fwnode);
dev_err(chip->dev, "Failed to init the device\n");
return ret;
}
--
2.30.2
Powered by blists - more mailing lists