From: Wentao Liang <vulab@iscas.ac.cn>
To: andrew+netdev@lunn.ch
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
linmq006@gmail.com, linux-kernel@vger.kernel.org,
madalin.bucur@nxp.com, netdev@vger.kernel.org, pabeni@redhat.com,
sean.anderson@linux.dev, Wentao Liang <vulab@iscas.ac.cn>,
stable@vger.kernel.org
Subject: [PATCH] fsl/fman: Fix fm_pdev reference leak in fman_port_probe()
Date: Thu, 17 Sep 2026 11:07:26 +0000 [thread overview]
Message-ID: <20260917110726.2148318-1-vulab@iscas.ac.cn> (raw)
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
next reply other threads:[~2026-09-17 11:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 11:07 Wentao Liang [this message]
2026-09-21 12:10 ` [PATCH] fsl/fman: Fix fm_pdev reference leak in fman_port_probe() netdev-bot+sashiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260917110726.2148318-1-vulab@iscas.ac.cn \
--to=vulab@iscas.ac.cn \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linmq006@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=madalin.bucur@nxp.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sean.anderson@linux.dev \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox