]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fsl/fman: Fix refcount handling of fman-related devices
authorAleksandr Mishin <amishin@t-argos.ru>
Tue, 15 Oct 2024 06:01:22 +0000 (09:01 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Nov 2024 01:02:36 +0000 (02:02 +0100)
commit3c2a3619d565fe16bf59b0a047bab103a2ee4490
tree97c128f4868cc55bfc764643527a2fa0e475d4c2
parentd0477572134cd6a1e28e5f6f48c39dca89860207
fsl/fman: Fix refcount handling of fman-related devices

[ Upstream commit 1dec67e0d9fbb087c2ab17bf1bd17208231c3bb1 ]

In mac_probe() there are multiple calls to of_find_device_by_node(),
fman_bind() and fman_port_bind() which takes references to of_dev->dev.
Not all references taken by these calls are released later on error path
in mac_probe() and in mac_remove() which lead to reference leaks.

Add references release.

Fixes: 3933961682a3 ("fsl/fman: Add FMan MAC driver")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/freescale/fman/mac.c