From f250e7bbe01b53a88ce0bc3e446f00cb397d2461 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 18 Jun 2009 15:14:07 +0200 Subject: [PATCH] Fix do_pci_register_device() to reject devfn already in use Signed-off-by: Markus Armbruster Signed-off-by: Anthony Liguori --- hw/pci.c | 2 ++ 1 file changed, 2 insertions(+) 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 @@ 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; -- 2.7.4