All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dsa: fix for_each_child.cocci warnings
  2021-07-11 14:27 drivers/net/dsa/microchip/ksz_common.c:418:3-35: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 423 kernel test robot
@ 2021-07-11 14:27 ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-07-11 14:27 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1928 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Alexander Lobakin <alobakin@pm.me>
CC: Vladimir Oltean <olteanv@gmail.com>
CC: Florian Fainelli <f.fainelli@gmail.com>
CC: Woojung Huh <woojung.huh@microchip.com>
CC: UNGLinuxDriver(a)microchip.com
CC: Andrew Lunn <andrew@lunn.ch>
CC: Vivien Didelot <vivien.didelot@gmail.com>
CC: Jakub Kicinski <kuba@kernel.org>
CC: netdev(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/net/dsa/microchip/ksz_common.c:418:3-35: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 423.


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

CC: Alexander Lobakin <alobakin@pm.me>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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

Please take the patch only if it's a positive warning. Thanks!

 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);
 			}

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

* [PATCH] dsa: fix for_each_child.cocci warnings
@ 2021-07-11 16:12 ` Julia Lawall
  0 siblings, 0 replies; 7+ messages in thread
From: Julia Lawall @ 2021-07-11 16:12 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1242 bytes --]

From: kernel test robot <lkp@intel.com>

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 <alobakin@pm.me>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
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);
 			}

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

* [PATCH] dsa: fix for_each_child.cocci warnings
@ 2021-07-11 16:12 ` Julia Lawall
  0 siblings, 0 replies; 7+ messages in thread
From: Julia Lawall @ 2021-07-11 16:12 UTC (permalink / raw)
  To: Alexander Lobakin
  Cc: Vladimir Oltean, Florian Fainelli, Woojung Huh, UNGLinuxDriver,
	Andrew Lunn, Vivien Didelot, Jakub Kicinski, netdev, linux-kernel,
	kbuild-all, linux-kernel

From: kernel test robot <lkp@intel.com>

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 <alobakin@pm.me>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
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);
 			}

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

* Re: [PATCH] dsa: fix for_each_child.cocci warnings
  2021-07-11 16:12 ` Julia Lawall
  (?)
@ 2021-07-11 17:10 ` patchwork-bot+netdevbpf
  -1 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-11 17:10 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]

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 <lkp@intel.com>
> 
> 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


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

* Re: [PATCH] dsa: fix for_each_child.cocci warnings
  2021-07-11 16:12 ` Julia Lawall
  (?)
  (?)
@ 2021-07-11 17:10 ` patchwork-bot+netdevbpf
  2021-07-11 21:20     ` Florian Fainelli
  -1 siblings, 1 reply; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-11 17:10 UTC (permalink / raw)
  To: Julia Lawall
  Cc: alobakin, olteanv, f.fainelli, woojung.huh, UNGLinuxDriver,
	andrew, vivien.didelot, kuba, netdev, linux-kernel, kbuild-all

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 <lkp@intel.com>
> 
> 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



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

* Re: [PATCH] dsa: fix for_each_child.cocci warnings
  2021-07-11 17:10 ` patchwork-bot+netdevbpf
@ 2021-07-11 21:20     ` Florian Fainelli
  0 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2021-07-11 21:20 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 759 bytes --]



On 7/11/2021 10:10 AM, patchwork-bot+netdevbpf(a)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:
>> From: kernel test robot <lkp@intel.com>
>>
>> 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

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

* Re: [PATCH] dsa: fix for_each_child.cocci warnings
@ 2021-07-11 21:20     ` Florian Fainelli
  0 siblings, 0 replies; 7+ messages in thread
From: Florian Fainelli @ 2021-07-11 21:20 UTC (permalink / raw)
  To: patchwork-bot+netdevbpf, Julia Lawall
  Cc: alobakin, olteanv, woojung.huh, UNGLinuxDriver, andrew,
	vivien.didelot, kuba, netdev, linux-kernel, kbuild-all



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:
>> From: kernel test robot <lkp@intel.com>
>>
>> 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

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

end of thread, other threads:[~2021-07-11 21:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-11 16:12 [PATCH] dsa: fix for_each_child.cocci warnings Julia Lawall
2021-07-11 16:12 ` Julia Lawall
2021-07-11 17:10 ` patchwork-bot+netdevbpf
2021-07-11 17:10 ` patchwork-bot+netdevbpf
2021-07-11 21:20   ` Florian Fainelli
2021-07-11 21:20     ` Florian Fainelli
  -- strict thread matches above, loose matches on Subject: below --
2021-07-11 14:27 drivers/net/dsa/microchip/ksz_common.c:418:3-35: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return around line 423 kernel test robot
2021-07-11 14:27 ` [PATCH] dsa: fix for_each_child.cocci warnings kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.