Skip to contentSkip to conversation

net/dsa/hirschmann: Add missing of_node_get() in hellcreek_led_setup()

PATCH Applied Liang He 2 participants 2 messages Jun 22, 2022 – Jun 24, 2022

Subsystems (4)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 net/dsa/hirschmann: Add missing of_node_get() in hellcreek_led_setup()

of_find_node_by_name() will decrease the refcount of its first arg and we need a of_node_get() to keep refcount balance.

---
 drivers/net/dsa/hirschmann/hellcreek_ptp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/dsa/hirschmann/hellcreek_ptp.c +1 -0
index 2572c6087bb5..b28baab6d56a 100644
@@ -300,6 +300,7 @@ static int hellcreek_led_setup(struct hellcreek *hellcreek)
 	const char *label, *state;
 	int ret = -EINVAL;
 
+	of_node_get(hellcreek->dev->of_node);
 	leds = of_find_node_by_name(hellcreek->dev->of_node, "leds");
 	if (!leds) {
 		dev_err(hellcreek->dev, "No LEDs specified in device tree!\n");
Signature · 1 line
2.25.1
#1 lore raw
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 7 lines · On Wed, 22 Jun 2022 12:06:21 +0800 you wrote:

of_find_node_by_name() will decrease the refcount of its first arg and we need a of_node_get() to keep refcount balance.

---
 drivers/net/dsa/hirschmann/hellcreek_ptp.c | 1 +
 1 file changed, 1 insertion(+)

Here is the summary with links:
- net/dsa/hirschmann: Add missing of_node_get() in hellcreek_led_setup()

    https://git.kernel.org/netdev/net/c/16d584d2fc8f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html