]> git.proxmox.com Git - qemu.git/commitdiff
Fix do_pci_register_device() to reject devfn already in use
authorMarkus Armbruster <armbru@redhat.com>
Thu, 18 Jun 2009 13:14:07 +0000 (15:14 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 22 Jun 2009 15:15:29 +0000 (10:15 -0500)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/pci.c

index 140cdbaa29e6f5b0c7f1ab5fe1fdb6c3f61d51c0..da76ecd34218e0f5198236413a8342b1da19f913 100644 (file)
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -267,6 +267,8 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
         }
         return NULL;
     found: ;
+    } else if (bus->devices[devfn]) {
+        return NULL;
     }
     pci_dev->bus = bus;
     pci_dev->devfn = devfn;