qemu-devel
[Top][All Lists]
Advanced

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

[PATCH] virtio-pci: fix vector_irqfd leak in virtio_pci_set_guest_notifi


From: Lei Xiang
Subject: [PATCH] virtio-pci: fix vector_irqfd leak in virtio_pci_set_guest_notifiers
Date: Mon, 8 Aug 2022 17:25:09 -0700

From: Lei Xiang <ninollx@hotmail.com>

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>
---
 hw/virtio/virtio-pci.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 45327f0..75188a9 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1058,6 +1058,10 @@ 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;
 }
 
-- 
1.9.1




reply via email to

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