From: Wentao Liang <vulab@iscas.ac.cn>
To: felipe.balbi@linux.intel.com
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org, pawell@cadence.com,
peter.chen@kernel.org, rogerq@kernel.org,
Wentao Liang <vulab@iscas.ac.cn>,
stable@vger.kernel.org
Subject: [PATCH] usb: cdns3: Fix PCI function reference leak in cdns3_pci_remove()
Date: Thu, 17 Sep 2026 16:06:22 +0000 [thread overview]
Message-ID: <20260917160622.2161638-1-vulab@iscas.ac.cn> (raw)
cdns3_get_second_fun() returns a device obtained with pci_get_device(),
which takes a reference to it. cdns3_pci_remove() uses the device only
to check whether the second function is enabled and then returns without
dropping the reference.
Release it before returning.
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/usb/cdns3/cdns3-pci-wrap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/cdns3/cdns3-pci-wrap.c b/drivers/usb/cdns3/cdns3-pci-wrap.c
index 1ad722e7704d..6639751ab22f 100644
--- a/drivers/usb/cdns3/cdns3-pci-wrap.c
+++ b/drivers/usb/cdns3/cdns3-pci-wrap.c
@@ -188,6 +188,8 @@ static void cdns3_pci_remove(struct pci_dev *pdev)
if (!pci_is_enabled(func))
kfree(wrap);
+
+ pci_dev_put(func);
}
static const struct pci_device_id cdns3_pci_ids[] = {
--
2.34.1
next reply other threads:[~2026-09-17 16:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 16:06 Wentao Liang [this message]
2026-10-09 1:44 ` [PATCH] usb: cdns3: Fix PCI function reference leak in cdns3_pci_remove() Peter Chen (Qualcomm)
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=20260917160622.2161638-1-vulab@iscas.ac.cn \
--to=vulab@iscas.ac.cn \
--cc=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pawell@cadence.com \
--cc=peter.chen@kernel.org \
--cc=rogerq@kernel.org \
--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