From: "Peter Chen (Qualcomm)" <peter.chen@kernel.org>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: felipe.balbi@linux.intel.com, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
pawell@cadence.com, rogerq@kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] usb: cdns3: Fix PCI function reference leak in cdns3_pci_remove()
Date: Thu, 8 Oct 2026 18:44:54 -0700 [thread overview]
Message-ID: <ashHFv7l3XWrqYzY@hu-petche-lv.qualcomm.com> (raw)
In-Reply-To: <20260917160622.2161638-1-vulab@iscas.ac.cn>
On 26-09-17 16:06:22, Wentao Liang wrote:
> 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>
Acked-by: Peter Chen <peter.chen@kernel.org>
Peter
> ---
> 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
>
--
Thanks,
Peter Chen
prev parent reply other threads:[~2026-10-09 1:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 16:06 [PATCH] usb: cdns3: Fix PCI function reference leak in cdns3_pci_remove() Wentao Liang
2026-10-09 1:44 ` Peter Chen (Qualcomm) [this message]
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=ashHFv7l3XWrqYzY@hu-petche-lv.qualcomm.com \
--to=peter.chen@kernel.org \
--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=rogerq@kernel.org \
--cc=stable@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/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