* [PATCH] dpaa_eth: Fix missing of_node_put in dpaa_get_ts_info()
@ 2022-04-08 9:49 cgel.zte
2022-04-11 11:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-08 9:49 UTC (permalink / raw)
To: madalin.bucur, davem, kuba, pabeni
Cc: netdev, linux-kernel, Lv Ruyi, Zeal Robot
From: Lv Ruyi <lv.ruyi@zte.com.cn>
Both of of_get_parent() and of_parse_phandle() return node pointer with
refcount incremented, use of_node_put() on it to decrease refcount
when done.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
index 763d2c7b5fb1..5750f9a56393 100644
--- a/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c
@@ -489,11 +489,15 @@ static int dpaa_get_ts_info(struct net_device *net_dev,
info->phc_index = -1;
fman_node = of_get_parent(mac_node);
- if (fman_node)
+ if (fman_node) {
ptp_node = of_parse_phandle(fman_node, "ptimer-handle", 0);
+ of_node_put(fman_node);
+ }
- if (ptp_node)
+ if (ptp_node) {
ptp_dev = of_find_device_by_node(ptp_node);
+ of_node_put(ptp_node);
+ }
if (ptp_dev)
ptp = platform_get_drvdata(ptp_dev);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dpaa_eth: Fix missing of_node_put in dpaa_get_ts_info()
2022-04-08 9:49 [PATCH] dpaa_eth: Fix missing of_node_put in dpaa_get_ts_info() cgel.zte
@ 2022-04-11 11:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-11 11:10 UTC (permalink / raw)
To: CGEL
Cc: madalin.bucur, davem, kuba, pabeni, netdev, linux-kernel,
lv.ruyi, zealci
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Fri, 8 Apr 2022 09:49:41 +0000 you wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> Both of of_get_parent() and of_parse_phandle() return node pointer with
> refcount incremented, use of_node_put() on it to decrease refcount
> when done.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> [...]
Here is the summary with links:
- dpaa_eth: Fix missing of_node_put in dpaa_get_ts_info()
https://git.kernel.org/netdev/net/c/1a7eb80d170c
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:[~2022-04-11 11:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 9:49 [PATCH] dpaa_eth: Fix missing of_node_put in dpaa_get_ts_info() cgel.zte
2022-04-11 11:10 ` 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).