From: kernel test robot <lkp(a)intel.com>
drivers/net/ethernet/microchip/sparx5/sparx5_main.c:633:1-33: WARNING: Function
"for_each_available_child_of_node" should have of_node_put() before goto around
lines 670.
Semantic patch information:
False positives can be due to function calls within the for_each
loop that may encapsulate an of_node_put.
Generated by: scripts/coccinelle/iterators/for_each_child.cocci
Fixes: 2f4edc4c2755 ("net: sparx5: add the basic sparx5 driver")
Reported-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
tree:
https://github.com/microchip-ung/linux-upstream.git
v5.12-rc2.net-next.sparx5_switchdev
head: c647e473e6ff8532c02ea3bd816aa477df3687f2
commit: 2f4edc4c2755886d8efc3e4fb40b362bfe65498b [15/41] net: sparx5: add the basic sparx5
driver
sparx5_main.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
@@ -667,6 +667,7 @@ static int mchp_sparx5_probe(struct plat
dev_err(sparx5->dev,
"port %u: missing serdes\n",
portno);
+ of_node_put(portnp);
goto cleanup_config;
}
config->portno = portno;