* [PATCH v2] net: cpsw: add missing of_node_put() in cpsw_probe_dt()
@ 2022-04-29 1:53 Yang Yingliang
2022-04-30 12:40 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2022-04-29 1:53 UTC (permalink / raw)
To: linux-kernel, netdev; +Cc: grygorii.strashko, davem, kuba
'tmp_node' need be put before returning from cpsw_probe_dt(),
so add missing of_node_put() in error path.
Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
v2:
add of_node_put() at label 'err_node_put'.
---
drivers/net/ethernet/ti/cpsw_new.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index bd4b1528cf99..79e850fe4621 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -1246,8 +1246,10 @@ static int cpsw_probe_dt(struct cpsw_common *cpsw)
data->slave_data = devm_kcalloc(dev, CPSW_SLAVE_PORTS_NUM,
sizeof(struct cpsw_slave_data),
GFP_KERNEL);
- if (!data->slave_data)
+ if (!data->slave_data) {
+ of_node_put(tmp_node);
return -ENOMEM;
+ }
/* Populate all the child nodes here...
*/
@@ -1341,6 +1343,7 @@ static int cpsw_probe_dt(struct cpsw_common *cpsw)
err_node_put:
of_node_put(port_np);
+ of_node_put(tmp_node);
return ret;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] net: cpsw: add missing of_node_put() in cpsw_probe_dt()
2022-04-29 1:53 [PATCH v2] net: cpsw: add missing of_node_put() in cpsw_probe_dt() Yang Yingliang
@ 2022-04-30 12:40 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-30 12:40 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-kernel, netdev, grygorii.strashko, davem, kuba
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Fri, 29 Apr 2022 09:53:37 +0800 you wrote:
> 'tmp_node' need be put before returning from cpsw_probe_dt(),
> so add missing of_node_put() in error path.
>
> Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
> v2:
> add of_node_put() at label 'err_node_put'.
>
> [...]
Here is the summary with links:
- [v2] net: cpsw: add missing of_node_put() in cpsw_probe_dt()
https://git.kernel.org/netdev/net/c/95098d5ac255
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-30 12:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 1:53 [PATCH v2] net: cpsw: add missing of_node_put() in cpsw_probe_dt() Yang Yingliang
2022-04-30 12:40 ` patchwork-bot+netdevbpf
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.