Netdev List
 help / color / mirror / Atom feed
* [PATCH] fsl/fman: Fix fm_pdev reference leak in fman_port_probe()
@ 2026-09-17 11:07 Wentao Liang
  2026-09-21 12:10 ` netdev-bot+sashiko
  0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2026-09-17 11:07 UTC (permalink / raw)
  To: andrew+netdev
  Cc: davem, edumazet, kuba, linmq006, linux-kernel, madalin.bucur,
	netdev, pabeni, sean.anderson, Wentao Liang, stable

of_find_device_by_node() takes a reference on the FMan device. It is
released on the error paths, but the successful path returns without
dropping it, leaking the reference.

Release the reference when it is not needed anymore.

Fixes: bf2b09fedc17 ("fsl/fman: Fix missing put_device() call in fman_port_probe")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/net/ethernet/freescale/fman/fman_port.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c
index 1b8fef69114e..f44a89016512 100644
--- a/drivers/net/ethernet/freescale/fman/fman_port.c
+++ b/drivers/net/ethernet/freescale/fman/fman_port.c
@@ -1868,6 +1868,8 @@ static int fman_port_probe(struct platform_device *of_dev)
 
 	dev_set_drvdata(&of_dev->dev, port);
 
+	put_device(&fm_pdev->dev);
+
 	return 0;
 
 put_device:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-21 12:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 11:07 [PATCH] fsl/fman: Fix fm_pdev reference leak in fman_port_probe() Wentao Liang
2026-09-21 12:10 ` netdev-bot+sashiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox