public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: dsa: Add missing of_node_put() in dsa_port_parse_of
@ 2022-03-16  8:26 Miaoqian Lin
  2022-03-17 12:12 ` Paolo Abeni
  2022-03-17 12:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Miaoqian Lin @ 2022-03-16  8:26 UTC (permalink / raw)
  To: Andrew Lunn, Vivien Didelot, Florian Fainelli, Vladimir Oltean,
	David S. Miller, Jakub Kicinski, netdev, linux-kernel
  Cc: linmq006

The device_node pointer is returned by of_parse_phandle()  with refcount
incremented. We should use of_node_put() on it when done.

Fixes: 6d4e5c570c2d ("net: dsa: get port type at parse time")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 net/dsa/dsa2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index b4e67758e104..1574f001725c 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -1436,6 +1436,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn)
 		const char *user_protocol;
 
 		master = of_find_net_device_by_node(ethernet);
+		of_node_put(ethernet);
 		if (!master)
 			return -EPROBE_DEFER;
 
-- 
2.17.1


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

* Re: [PATCH] net: dsa: Add missing of_node_put() in dsa_port_parse_of
  2022-03-16  8:26 [PATCH] net: dsa: Add missing of_node_put() in dsa_port_parse_of Miaoqian Lin
@ 2022-03-17 12:12 ` Paolo Abeni
  2022-03-17 12:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Abeni @ 2022-03-17 12:12 UTC (permalink / raw)
  To: Miaoqian Lin, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	Vladimir Oltean, David S. Miller, Jakub Kicinski, netdev,
	linux-kernel

On Wed, 2022-03-16 at 08:26 +0000, Miaoqian Lin wrote:
> The device_node pointer is returned by of_parse_phandle()  with refcount
> incremented. We should use of_node_put() on it when done.
> 
> Fixes: 6d4e5c570c2d ("net: dsa: get port type at parse time")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

LGTM, thanks! 

For the records, it looks like there is a similar issue in
net/dsa/port.c: dsa_port_link_register_of().

Thanks!

Paolo


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

* Re: [PATCH] net: dsa: Add missing of_node_put() in dsa_port_parse_of
  2022-03-16  8:26 [PATCH] net: dsa: Add missing of_node_put() in dsa_port_parse_of Miaoqian Lin
  2022-03-17 12:12 ` Paolo Abeni
@ 2022-03-17 12:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-03-17 12:40 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: andrew, vivien.didelot, f.fainelli, olteanv, davem, kuba, netdev,
	linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Wed, 16 Mar 2022 08:26:02 +0000 you wrote:
> The device_node pointer is returned by of_parse_phandle()  with refcount
> incremented. We should use of_node_put() on it when done.
> 
> Fixes: 6d4e5c570c2d ("net: dsa: get port type at parse time")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>  net/dsa/dsa2.c | 1 +
>  1 file changed, 1 insertion(+)

Here is the summary with links:
  - net: dsa: Add missing of_node_put() in dsa_port_parse_of
    https://git.kernel.org/netdev/net/c/cb0b430b4e3a

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] 3+ messages in thread

end of thread, other threads:[~2022-03-17 12:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-16  8:26 [PATCH] net: dsa: Add missing of_node_put() in dsa_port_parse_of Miaoqian Lin
2022-03-17 12:12 ` Paolo Abeni
2022-03-17 12:40 ` 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