[PATCH] dsa: fix for_each_child.cocci warnings

STALE1869d

3 messages, 3 authors, 2021-07-11 · open the first message on its own page

[PATCH] dsa: fix for_each_child.cocci warnings

From: Julia Lawall <julia.lawall@inria.fr>
Date: 2021-07-11 16:13:00

From: kernel test robot <redacted>

For_each_available_child_of_node should have of_node_put() before
return around line 423.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

CC: Alexander Lobakin <redacted>
Reported-by: kernel test robot <redacted>
Signed-off-by: kernel test robot <redacted>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   de5540965853e514a85d3b775e9049deb85a2ff3
commit: 227d72063fccb2d19b30fb4197fba478514f7d83 dsa: simplify Kconfig symbols and dependencies
:::::: branch date: 15 hours ago
:::::: commit date: 4 months ago

 ksz_common.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -419,8 +419,10 @@ int ksz_switch_register(struct ksz_devic
 				if (of_property_read_u32(port, "reg",
 							 &port_num))
 					continue;
-				if (!(dev->port_mask & BIT(port_num)))
+				if (!(dev->port_mask & BIT(port_num))) {
+					of_node_put(port);
 					return -EINVAL;
+				}
 				of_get_phy_mode(port,
 						&dev->ports[port_num].interface);
 			}

Re: [PATCH] dsa: fix for_each_child.cocci warnings

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-07-11 17:10:06

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Sun, 11 Jul 2021 18:12:56 +0200 (CEST) you wrote:
From: kernel test robot <redacted>

For_each_available_child_of_node should have of_node_put() before
return around line 423.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

[...]
Here is the summary with links:
  - dsa: fix for_each_child.cocci warnings
    https://git.kernel.org/netdev/net/c/84f7e0bb4809

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

Re: [PATCH] dsa: fix for_each_child.cocci warnings

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2021-07-11 21:20:43


On 7/11/2021 10:10 AM, patchwork-bot+netdevbpf@kernel.org wrote:
Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Sun, 11 Jul 2021 18:12:56 +0200 (CEST) you wrote:
quoted
From: kernel test robot <redacted>

For_each_available_child_of_node should have of_node_put() before
return around line 423.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

[...]
Here is the summary with links:
   - dsa: fix for_each_child.cocci warnings
     https://git.kernel.org/netdev/net/c/84f7e0bb4809
The patch subject should have been:

net: dsa: microchip: fix for_each_child.cocci warning

(singular, not plural), yes I like to paint my bike shed blue.
--
Florian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help