A single bugfix for a error handling issue in pci.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJY47ywAAoJECgfDbjSjVRpqCgH/3bINQKosB7x8308IcfUbv9A
 hBWHs26cVUtqwmU7zjqKTIodkGrVA9Zf9K8+7rRNd0HPGYFwIMYgQtbqM+R2LSWy
 3oW5nlmi8Q4O2beZ2fXB0pjkoyBzErWqzNakgMi4Sb6rFvZP6J6HyIHv5YwKOuxL
 CHKOnrBRwjiTUPLPiTVzQu8MdXlqdw5E5TTTPwUnLbBAqpycG1RZHgymzX6IyHTv
 SMlpY2iJ9I/QVB4NqZjRmInABY+XmMYCap2Rt26QvUmL2mChUxit/DeOIwRx+JEn
 WV0Ldb4nPB/huAqgqP+zX1eEIBuMz7qd2Zop+R5WABcs8tDX85yQkikY9CIz7hc=
 =9Sy6
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pci: fix

A single bugfix for a error handling issue in pci.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Tue 04 Apr 2017 16:33:04 BST
# gpg:                using RSA key 0x281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  pci: Only unmap bus_master_enabled_region if was added previously

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2017-04-04 17:27:32 +01:00
commit 2c9938c5d7
1 changed files with 4 additions and 2 deletions

View File

@ -869,8 +869,10 @@ static void do_pci_unregister_device(PCIDevice *pci_dev)
pci_dev->bus->devices[pci_dev->devfn] = NULL;
pci_config_free(pci_dev);
memory_region_del_subregion(&pci_dev->bus_master_container_region,
&pci_dev->bus_master_enable_region);
if (memory_region_is_mapped(&pci_dev->bus_master_enable_region)) {
memory_region_del_subregion(&pci_dev->bus_master_container_region,
&pci_dev->bus_master_enable_region);
}
address_space_destroy(&pci_dev->bus_master_as);
}