aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2009-06-18 15:14:07 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-22 10:15:29 -0500
commit07b7d05377a5e2b242ef0cce3d461d3284700fc0 (patch)
tree26b40ccb2976bea36390e5c71868669fb8f39a59 /hw
parent9391e4b8828a6ebcde843a2012f0fae4b601b302 (diff)
Fix do_pci_register_device() to reject devfn already in use
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pci.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 140cdbaa29..da76ecd342 100644
--- 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;