pci: Unregister BARs before device exit
commit7cf1b0fd95657e722b2ad290649eee88d1365786
authorAlex Williamson <alex.williamson@redhat.com>
Wed, 4 Jul 2012 04:39:34 +0000 (3 22:39 -0600)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 4 Jul 2012 12:55:07 +0000 (4 15:55 +0300)
treea3a32e78cb8a50b0de6955f798291ec277b13dc9
parentf90c2bcdbc69e41e575f868b984c3e2de8f51bac
pci: Unregister BARs before device exit

BARs are registered in init functions from memory regions created
by the drivers.  Exit functions destroy those memory regions.
By unregistering the io regions after exit(), we're calling
memory_region_del_subregion on freed memory.  Don't do that.  The
option rom comes along for the ride because it's more symmetric
to how it's created.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci.c