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:
parent
9391e4b882
commit
07b7d05377
2
hw/pci.c
2
hw/pci.c
@ -267,6 +267,8 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
found: ;
|
found: ;
|
||||||
|
} else if (bus->devices[devfn]) {
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
pci_dev->bus = bus;
|
pci_dev->bus = bus;
|
||||||
pci_dev->devfn = devfn;
|
pci_dev->devfn = devfn;
|
||||||
|
Loading…
Reference in New Issue
Block a user