[PATCH] net: sparx5: Add of_node_put() before goto

Subsystems: networking drivers, the rest

STALE1765d

2 messages, 2 authors, 2021-10-18 · open the first message on its own page

[PATCH] net: sparx5: Add of_node_put() before goto

From: Wan Jiabing <hidden>
Date: 2021-10-18 01:32:30

Fix following coccicheck warning:
./drivers/net/ethernet/microchip/sparx5/s4parx5_main.c:723:1-33: WARNING: Function
for_each_available_child_of_node should have of_node_put() before goto

Early exits from for_each_available_child_of_node should decrement the
node reference counter.

Signed-off-by: Wan Jiabing <redacted>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
index c6eb0b70dd3f..4625d4fb4cde 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
@@ -757,6 +757,7 @@ static int mchp_sparx5_probe(struct platform_device *pdev)
 			err = dev_err_probe(sparx5->dev, PTR_ERR(serdes),
 					    "port %u: missing serdes\n",
 					    portno);
+			of_node_put(portnp);
 			goto cleanup_config;
 		}
 		config->portno = portno;
-- 
2.20.1

Re: [PATCH] net: sparx5: Add of_node_put() before goto

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-10-18 12:50:12

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller [off-list ref]:

On Sun, 17 Oct 2021 21:31:30 -0400 you wrote:
Fix following coccicheck warning:
./drivers/net/ethernet/microchip/sparx5/s4parx5_main.c:723:1-33: WARNING: Function
for_each_available_child_of_node should have of_node_put() before goto

Early exits from for_each_available_child_of_node should decrement the
node reference counter.

[...]
Here is the summary with links:
  - net: sparx5: Add of_node_put() before goto
    https://git.kernel.org/netdev/net/c/d9fd7e9fccfa

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help