linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: mscc: ocelot: Add of_node_put() before goto
@ 2021-10-18  1:32 Wan Jiabing
  2021-10-18 12:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Wan Jiabing @ 2021-10-18  1:32 UTC (permalink / raw)
  To: Vladimir Oltean, Claudiu Manoil, Alexandre Belloni,
	UNGLinuxDriver, David S. Miller, Jakub Kicinski, netdev,
	linux-kernel
  Cc: kael_w, Wan Jiabing

Fix following coccicheck warning:
./drivers/net/ethernet/mscc/ocelot_vsc7514.c:946: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 <wanjiabing@vivo.com>
---
 drivers/net/ethernet/mscc/ocelot_vsc7514.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
index 5d01993f6be0..38103b0255b0 100644
--- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c
+++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c
@@ -969,6 +969,7 @@ static int mscc_ocelot_init_ports(struct platform_device *pdev,
 		target = ocelot_regmap_init(ocelot, res);
 		if (IS_ERR(target)) {
 			err = PTR_ERR(target);
+			of_node_put(portnp);
 			goto out_teardown;
 		}
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: mscc: ocelot: Add of_node_put() before goto
  2021-10-18  1:32 [PATCH] net: mscc: ocelot: Add of_node_put() before goto Wan Jiabing
@ 2021-10-18 12:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-18 12:50 UTC (permalink / raw)
  To: Wan Jiabing
  Cc: vladimir.oltean, claudiu.manoil, alexandre.belloni,
	UNGLinuxDriver, davem, kuba, netdev, linux-kernel, kael_w

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Sun, 17 Oct 2021 21:32:32 -0400 you wrote:
> Fix following coccicheck warning:
> ./drivers/net/ethernet/mscc/ocelot_vsc7514.c:946: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: mscc: ocelot: Add of_node_put() before goto
    https://git.kernel.org/netdev/net/c/d1a7b9e46965

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-18 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18  1:32 [PATCH] net: mscc: ocelot: Add of_node_put() before goto Wan Jiabing
2021-10-18 12:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).