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>
diff --git a/hw/pci.c b/hw/pci.c index 140cdba..da76ecd 100644 --- a/hw/pci.c +++ b/hw/pci.c
@@ -267,6 +267,8 @@ } return NULL; found: ; + } else if (bus->devices[devfn]) { + return NULL; } pci_dev->bus = bus; pci_dev->devfn = devfn;