Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Guangshuo Li <lgs201920130244@gmail.com>
Cc: Yaxing Guo <guoyaxing@bosc.ac.cn>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] uio: fix IRQ vector leak on probe failure and remove
Date: Fri, 22 May 2026 12:03:38 +0200	[thread overview]
Message-ID: <2026052229-overspend-preoccupy-2f6f@gregkh> (raw)
In-Reply-To: <20260416155443.3949056-1-lgs201920130244@gmail.com>

On Thu, Apr 16, 2026 at 11:54:43PM +0800, Guangshuo Li wrote:
> probe() allocates MSI/MSI-X vectors with pci_alloc_irq_vectors(), but
> neither the error path nor remove() releases them with
> pci_free_irq_vectors().
> 
> Unlike drivers using pcim_enable_device(), this driver uses
> pci_enable_device(), so the IRQ vectors are not managed automatically
> and must be freed explicitly.
> 
> Add pci_free_irq_vectors() to the probe error path after successful
> vector allocation and to remove(). The issue was identified by a
> static analysis tool I developed.
> 
> Fixes: 3397c3cd859a ("uio: Add SVA support for PCI devices via uio_pci_generic_sva.c")
> Cc: stable@vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> ---
>  drivers/uio/uio_pci_generic_sva.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/uio/uio_pci_generic_sva.c b/drivers/uio/uio_pci_generic_sva.c
> index 4a46acd994a8..ea531f9a164c 100644
> --- a/drivers/uio/uio_pci_generic_sva.c
> +++ b/drivers/uio/uio_pci_generic_sva.c
> @@ -62,7 +62,7 @@ static int uio_pci_sva_release(struct uio_info *info, struct inode *inode)
>  static int probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  {
>  	struct uio_pci_sva_dev *udev;
> -	int ret, i, irq = 0;
> +	int ret, i, irq = 0, have_irq_vectors = 0;

have_irq_vectors should be a bool.

  reply	other threads:[~2026-05-22 10:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-16 15:54 [PATCH] uio: fix IRQ vector leak on probe failure and remove Guangshuo Li
2026-05-22 10:03 ` Greg Kroah-Hartman [this message]
2026-05-24  6:29   ` Guangshuo Li

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=2026052229-overspend-preoccupy-2f6f@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=guoyaxing@bosc.ac.cn \
    --cc=lgs201920130244@gmail.com \
    --cc=linux-kernel@vger.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