aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@intel.com>2023-06-29 16:40:39 +0800
committerCédric Le Goater <clg@redhat.com>2023-06-30 06:02:51 +0200
commit0cc889c8826cefa5b80110d31a62273b56aa1832 (patch)
tree5b9f56310890e6c6a965869839c5c1b2c5ec2527 /hw/vfio
parent357bd7932a136613d700ee8bc83e9165f059d1f7 (diff)
downloadqemu-0cc889c8826cefa5b80110d31a62273b56aa1832.zip
qemu-0cc889c8826cefa5b80110d31a62273b56aa1832.tar.gz
qemu-0cc889c8826cefa5b80110d31a62273b56aa1832.tar.bz2
vfio/pci: Free leaked timer in vfio_realize error path
When vfio_realize fails, the mmap_timer used for INTx optimization isn't freed. As this timer isn't activated yet, the potential impact is just a piece of leaked memory. Fixes: ea486926b07d ("vfio-pci: Update slow path INTx algorithm timer related") Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> Reviewed-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Joao Martins <joao.m.martins@oracle.com> Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw/vfio')
-rw-r--r--hw/vfio/pci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 48df517..ab6645b 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3224,6 +3224,9 @@ out_deregister:
if (vdev->irqchip_change_notifier.notify) {
kvm_irqchip_remove_change_notifier(&vdev->irqchip_change_notifier);
}
+ if (vdev->intx.mmap_timer) {
+ timer_free(vdev->intx.mmap_timer);
+ }
out_teardown:
vfio_teardown_msi(vdev);
vfio_bars_exit(vdev);