Browse Source

vfio-pci: Cleanup on INTx setup failure

Missing some unwind code.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Alex Williamson 13 years ago
parent
commit
ce59af2dba
1 changed files with 2 additions and 0 deletions
  1. 2 0
      hw/vfio_pci.c

+ 2 - 0
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)) {
     if (ioctl(vdev->fd, VFIO_DEVICE_SET_IRQS, &irq_set_fd)) {
         error_report("vfio: Error: Failed to setup INTx fd: %m\n");
         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;
         return -errno;
     }
     }