Thread (4 messages) 4 messages, 3 authors, 2022-09-20

Re:[PATCH v2] of: mdio: Add of_node_put() when breaking out of for_each_xx

From: Liang He <hidden>
Date: 2022-09-13 18:44:21



At 2022-09-13 20:56:59, "Liang He" [off-list ref] 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 <redacted>
Co-developed-by: Miaoqian Lin <redacted>
Signed-off-by: Liang He <redacted>
Signed-off-by: Miaoqian Lin <redacted>
Hi, Miaoqian, 
this Sob should directly from you,
please do it!

quoted hunk ↗ jump to hunk
---
v2: use proper tag advised by Jakub Kicinski
v1: fix the bug

drivers/net/mdio/of_mdio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c
index 9e3c815a070f..796e9c7857d0 100644
--- a/drivers/net/mdio/of_mdio.c
+++ b/drivers/net/mdio/of_mdio.c
@@ -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;
}
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help