Patchwork [11/11] vfio-pci: Cleanup on INTx setup failure

login
register
mail settings
Submitter Alex Williamson
Date Oct. 4, 2012, 10:18 p.m.
Message ID <20121004221844.3189.88455.stgit@bling.home>
Download mbox | patch
Permalink /patch/189358/
State New
Headers show

Comments

Alex Williamson - Oct. 4, 2012, 10:18 p.m.
Missing some unwind code.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---

 hw/vfio_pci.c |    2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/hw/vfio_pci.c b/hw/vfio_pci.c
index b2383c4..2325272 100644
--- a/hw/vfio_pci.c
+++ b/hw/vfio_pci.c
@@ -285,6 +285,8 @@  static int vfio_enable_intx(VFIODevice *vdev)
 
     if (ioctl(vdev->fd, VFIO_DEVICE_SET_IRQS, &irq_set_fd)) {
         error_report("vfio: Error: Failed to setup INTx fd: %m\n");
+        qemu_set_fd_handler(irq_set_fd.fd, NULL, NULL, vdev);
+        event_notifier_cleanup(&vdev->intx.interrupt);
         return -errno;
     }