qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] virtio-pci: Fix the failure process in kvm_virtio_pci_vector


From: Peter Maydell
Subject: Re: [PATCH] virtio-pci: Fix the failure process in kvm_virtio_pci_vector_use_one()
Date: Tue, 16 Apr 2024 13:30:42 +0100

On Tue, 16 Apr 2024 at 13:29, Cindy Lu <lulu@redhat.com> wrote:
>
> In function kvm_virtio_pci_vector_use_one(), in the undo label,
> the function will get the vector incorrectly while using
> VIRTIO_CONFIG_IRQ_IDX
> To fix this, we remove this label and simplify the failure process
>
> Fixes: f9a09ca3ea ("vhost: add support for configure interrupt")
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Cindy Lu <lulu@redhat.com>
> ---
>  hw/virtio/virtio-pci.c | 19 +++----------------
>  1 file changed, 3 insertions(+), 16 deletions(-)
>
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index b138fa127a..565bdb0897 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -892,7 +892,7 @@ static int kvm_virtio_pci_vector_use_one(VirtIOPCIProxy 
> *proxy, int queue_no)
>      }
>      ret = kvm_virtio_pci_vq_vector_use(proxy, vector);
>      if (ret < 0) {
> -        goto undo;
> +        return ret;
>      }
>      /*
>       * If guest supports masking, set up irqfd now.
> @@ -902,25 +902,12 @@ static int kvm_virtio_pci_vector_use_one(VirtIOPCIProxy 
> *proxy, int queue_no)
>          ret = kvm_virtio_pci_irqfd_use(proxy, n, vector);
>          if (ret < 0) {
>              kvm_virtio_pci_vq_vector_release(proxy, vector);
> -            goto undo;
> +            kvm_virtio_pci_irqfd_release(proxy, n, vector);

Are you sure this is right? The kvm_virtio_pci_irqfd_use()
just failed, so why do we need to call
kvm_virtio_pci_irqfd_release() ?

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]