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>
This commit is contained in:
Markus Armbruster 2009-06-18 15:14:07 +02:00 committed by Anthony Liguori
parent 9391e4b882
commit 07b7d05377
1 changed files with 2 additions and 0 deletions

View File

@ -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;