Skip to contentSkip to conversation

of: mdio: Add of_node_put() when breaking out of for_each_xx

PATCH Applied Liang He 3 participants 4 messages Sep 13, 2022 – Sep 20, 2022

Subsystems (3)
lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH v2 1/1 of: mdio: Add of_node_put() when breaking out of for_each_xx

In of_mdiobus_register(), we should call of_node_put() for 'child' escaped out of for_each_available_child_of_node().

Fixes 66bdede495c7 ("of_mdio: Fix broken PHY IRQ in case of probe deferral")
Cc Miaoqian Lin <[email protected]>

---
v2: use proper tag advised by Jakub Kicinski
v1: fix the bug

 drivers/net/mdio/of_mdio.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/mdio/of_mdio.c +1 -0
index 9e3c815a070f..796e9c7857d0 100644
@@ -231,6 +231,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 	return 0;
 
 unregister:
+	of_node_put(child);
 	mdiobus_unregister(mdio);
 	return rc;
 }
Signature · 1 line
2.25.1
author
#1 lore raw
Quoted 8 lines · Liang He

In of_mdiobus_register(), we should call of_node_put() for 'child' escaped out of for_each_available_child_of_node().

Fixes 66bdede495c7 ("of_mdio: Fix broken PHY IRQ in case of probe deferral")
Cc Miaoqian Lin <[email protected]>

Hi, Miaoqian,
this Sob should directly from you,
please do it!

Quoted 21 lines

---
v2: use proper tag advised by Jakub Kicinski
v1: fix the bug

drivers/net/mdio/of_mdio.c | 1 +

1 file changed, 1 insertion(+)
drivers/net/mdio/of_mdio.c +0 -0
index 9e3c815a070f..796e9c7857d0 100644
@@ -231,6 +231,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 	return 0;
 

unregister:

drivers/net/mdio/of_mdio.c +1 -0
+	of_node_put(child);
	mdiobus_unregister(mdio);
	return rc;
}
Signature · 1 line
2.25.1
#2 lore raw
Quoted 4 lines · Liang He

At 2022-09-13 20:56:59, "Liang He" <[email protected]> wrote:

Quoted 8 lines
Quoted 8 lines

In of_mdiobus_register(), we should call of_node_put() for 'child' escaped out of for_each_available_child_of_node().

Fixes 66bdede495c7 ("of_mdio: Fix broken PHY IRQ in case of probe deferral")
Cc Miaoqian Lin <[email protected]>
Quoted 27 lines

Hi, Miaoqian,
this Sob should directly from you,
please do it!

Quoted 21 lines

---
v2: use proper tag advised by Jakub Kicinski
v1: fix the bug

drivers/net/mdio/of_mdio.c | 1 +

1 file changed, 1 insertion(+)
drivers/net/mdio/of_mdio.c +0 -0
index 9e3c815a070f..796e9c7857d0 100644
@@ -231,6 +231,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 	return 0;
 

unregister:

drivers/net/mdio/of_mdio.c +1 -0
+	of_node_put(child);
	mdiobus_unregister(mdio);
	return rc;
}
Signature · 1 line
2.25.1
#3 lore raw
In reply to Liang He
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 10 lines · On Tue, 13 Sep 2022 20:56:59 +0800 you wrote:

In of_mdiobus_register(), we should call of_node_put() for 'child' escaped out of for_each_available_child_of_node().

Fixes 66bdede495c7 ("of_mdio: Fix broken PHY IRQ in case of probe deferral")
Cc Miaoqian Lin <[email protected]>

[...]

Here is the summary with links:
- [v2] of: mdio: Add of_node_put() when breaking out of for_each_xx

    https://git.kernel.org/netdev/net/c/1c48709e6d9d

You are awesome, thank you!

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