qemu-devel
[Top][All Lists]
Advanced

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

Re: [RESEND PATCH] virtio-pci: fix vector_irqfd leak in virtio_pci_set_g


From: Michael S. Tsirkin
Subject: Re: [RESEND PATCH] virtio-pci: fix vector_irqfd leak in virtio_pci_set_guest_notifiers
Date: Wed, 30 Nov 2022 01:59:28 -0500

On Wed, Nov 30, 2022 at 01:56:11PM +0800, leixiang wrote:
> proxy->vector_irqfd did not free when set guest notifier failed.
> 
> Signed-off-by: Lei Xiang <leixiang@kylinos.cn>
> Tested-by: Zeng Chi <zengchi@kylinos.cn>
> Suggested-by: Xie Ming <xieming@kylinos.cn>

Thanks a lot!  Fixes tag? When was the leak introduced?

> ---
>  hw/virtio/virtio-pci.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index c6b47a9c..4862f83b 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -1038,6 +1038,12 @@ assign_error:
>      while (--n >= 0) {
>          virtio_pci_set_guest_notifier(d, n, !assign, with_irqfd);
>      }
> +
> +   g_free(proxy->vector_irqfd);
> +   proxy->vector_irqfd = NULL;
> +
>      return r;
>  }
>  
> -- 
> 
> 
> No virus found
>               Checked by Hillstone Network AntiVirus




reply via email to

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