]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commit
vfio-pci: Fix missing unparent of dynamically allocated MemoryRegion
authorAlex Williamson <alex.williamson@redhat.com>
Wed, 4 Feb 2015 18:45:32 +0000 (11:45 -0700)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 24 Feb 2015 00:04:34 +0000 (18:04 -0600)
commit4d49de6b6f9b45446dd31990a177b13953f2e842
tree06685b605660f40cba73c1bd6396cac8665f3888
parent3750d2588e8d8d204820fef4ce95d7c271bafd3f
vfio-pci: Fix missing unparent of dynamically allocated MemoryRegion

Commit d8d95814609e added explicit object_unparent() calls for
dynamically allocated MemoryRegions.  The VFIOMSIXInfo structure also
contains such a MemoryRegion, covering the mmap'd region of a PCI BAR
above the MSI-X table.  This structure is freed as part of the class
exit function and therefore also needs an explicit object_unparent().
Failing to do this results in random segfaults due to fields within
the structure, often the class pointer, being reclaimed and corrupted
by the time object_finalize_child_property() is called for the object.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-stable@nongnu.org # 2.2
(cherry picked from commit 3a4dbe6aa934370a92372528c1255ee1504965ee)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/misc/vfio.c