Skip to contentSkip to conversation

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

PATCH Superseded Liang He 2 participants 2 messages Jul 27, 2022 – Jul 28, 2022

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 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")
---
 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
maintainer
#1 lore raw
Quoted 5 lines · On Wed, 27 Jul 2022 15:44:09 +0800 Liang He 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")

The standard tag is Co-developed-by, and the other developer must also provide their sign-off. When reposting please make sure to CC the author of the patch under Fixes.

Quoted 1 line