[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220913125659.3331969-1-windhl@126.com>
Date: Tue, 13 Sep 2022 20:56:59 +0800
From: Liang He <windhl@....com>
To: windhl@....com, andrew@...n.ch, hkallweit1@...il.com,
linux@...linux.org.uk, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, netdev@...r.kernel.org,
linmq006@...il.com
Subject: [PATCH v2] 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 <linmq006@...il.com>
Co-developed-by: Miaoqian Lin <linmq006@...il.com>
Signed-off-by: Liang He <windhl@....com>
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
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
Powered by blists - more mailing lists