virtio-pci: fix proxy->vector_irqfd leak in virtio_pci_set_guest_notifiers

proxy->vector_irqfd did not free when kvm_virtio_pci_vector_use or
msix_set_vector_notifiers failed in virtio_pci_set_guest_notifiers.

Fixes: 7d37d351

Signed-off-by: Lei Xiang <leixiang@kylinos.cn>
Tested-by: Zeng Chi <zengchi@kylinos.cn>
Suggested-by: Xie Ming <xieming@kylinos.cn>
Message-Id: <20221227081604.806415-1-leixiang@kylinos.cn>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
leixiang 2022-12-27 16:16:04 +08:00 committed by Michael S. Tsirkin
parent e66f2311d6
commit 4396d4bd74

View File

@ -1291,6 +1291,8 @@ assign_error:
while (--n >= 0) { while (--n >= 0) {
virtio_pci_set_guest_notifier(d, n, !assign, with_irqfd); virtio_pci_set_guest_notifier(d, n, !assign, with_irqfd);
} }
g_free(proxy->vector_irqfd);
proxy->vector_irqfd = NULL;
return r; return r;
} }