Hold the PCI device list lock when removing an element.

MFC after:	1 week
This commit is contained in:
markj 2017-07-04 00:02:06 +00:00
parent 40df8c5732
commit 8123dae824

View File

@ -254,7 +254,9 @@ pci_unregister_driver(struct pci_driver *pdrv)
bus = devclass_find("pci");
spin_lock(&pci_lock);
list_del(&pdrv->links);
spin_unlock(&pci_lock);
mtx_lock(&Giant);
if (bus != NULL)
devclass_delete_driver(bus, &pdrv->driver);