]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: ti: am65-cpsw-nuss: Fix some refcount leaks
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 26 May 2022 08:52:08 +0000 (12:52 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:10 +0000 (18:36 +0200)
commit2fa047ab5e82b48a514679beb7dc85691dd2c800
treee987ec75530dd0b800437fb77f4efd87164e1613
parent456a9d24b1ce1821114f78cb0afd391c5aaf5fba
net: ethernet: ti: am65-cpsw-nuss: Fix some refcount leaks

[ Upstream commit 9642678ed1b10d806723d82cf6153b23e1ce9275 ]

of_get_child_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
am65_cpsw_init_cpts() and am65_cpsw_nuss_probe() don't release
the refcount in error case.
Add missing of_node_put() to avoid refcount leak.

Fixes: ed8eb260deff ("net: ethernet: ti: am65-cpsw-nuss: enable packet timestamping support")
Fixes: ddd326a112f7 ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/ti/am65-cpsw-nuss.c