]> 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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 May 2022 07:00:40 +0000 (08:00 +0100)
commiteb1324f1fa3f369ec87b1c34107a0f1370c39c44
treed9969ec05020be38f34d2f5a923b0668c17b0042
parent9a1ac7adaf5400dbdf21a246e6b97db8788a7313
net: ethernet: ti: am65-cpsw-nuss: Fix some refcount leaks

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: 1448b012fa6c ("net: ethernet: ti: am65-cpsw-nuss: enable packet timestamping support")
Fixes: e7364a21077b ("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>
drivers/net/ethernet/ti/am65-cpsw-nuss.c