]> Git Repo - qemu.git/commitdiff
pci-assign: Fix a bug when map MSI-X table memory failed
authorGonglei <[email protected]>
Thu, 3 Apr 2014 05:18:23 +0000 (13:18 +0800)
committerPaolo Bonzini <[email protected]>
Tue, 13 May 2014 11:12:04 +0000 (13:12 +0200)
When mmapping memory for the MSI-X table failsthe dev->msix_table is
not set to NULL and assigned_dev_unregister_msix_mmio() will cause
a segfault when trying to munmap it.

Signed-off-by: Gonglei Arei <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Signed-off-by: Gonglei <[email protected]>
hw/i386/kvm/pci-assign.c

index e55421adcd75568d34a8c1382f625988c2d6e3fd..0572821f2102496783b39ed6bea3a116156cf45b 100644 (file)
@@ -1664,6 +1664,7 @@ static void assigned_dev_register_msix_mmio(AssignedDevice *dev, Error **errp)
                            MAP_ANONYMOUS|MAP_PRIVATE, 0, 0);
     if (dev->msix_table == MAP_FAILED) {
         error_setg_errno(errp, errno, "failed to allocate msix_table");
+        dev->msix_table = NULL;
         return;
     }
 
This page took 0.030771 seconds and 4 git commands to generate.