From: Markus Armbruster Date: Thu, 18 Jun 2009 13:14:07 +0000 (+0200) Subject: Fix do_pci_register_device() to reject devfn already in use X-Git-Tag: qemu-xen-4.2.0~6778 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=07b7d05377a5e2b242ef0cce3d461d3284700fc0;p=qemu-xen.git Fix do_pci_register_device() to reject devfn already in use Signed-off-by: Markus Armbruster Signed-off-by: Anthony Liguori --- 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;