]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: ethernet: ti: am65-cpsw: fix port_np reference counting
authorMichael Walle <mwalle@kernel.org>
Mon, 14 Apr 2025 08:39:42 +0000 (10:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:45:42 +0000 (10:45 +0200)
commit94d5809c7fa8608c60dc538cf2236c4418da14f0
tree9bc86e43834dfe5c718c29a799226891b7cc18ba
parent422b7b9d1362b691d30eaa9b912a45fddb50df4d
net: ethernet: ti: am65-cpsw: fix port_np reference counting

[ Upstream commit 903d2b9f9efc5b3339d74015fcfc0d9fff276c4c ]

A reference to the device tree node is stored in a private struct, thus
the reference count has to be incremented. Also, decrement the count on
device removal and in the error path.

Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
Signed-off-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250414083942.4015060-1-mwalle@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/ti/am65-cpsw-nuss.c