From: Mark McLoughlin <[EMAIL PROTECTED]>

Fixes a segfault in assigned_dev_update_irq() if assigning a device
previously failed.

Signed-off-by: Mark McLoughlin <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c
index 8fbd66c..b5cf6ee 100644
--- a/qemu/hw/device-assignment.c
+++ b/qemu/hw/device-assignment.c
@@ -550,8 +550,11 @@ struct PCIDevice *init_assigned_device(AssignedDevInfo 
*adev, PCIBus *bus)
     }
 
     adev->assigned_dev = dev;
-  out:
     return &dev->dev;
+
+out:
+    pci_unregister_device(&dev->dev);
+    return NULL;
 }
 
 /*
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to