From 0a930cf0785a075f3d839a39e73ac8975c91e584 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 4 Jul 2017 00:02:06 +0000 Subject: [PATCH] Hold the PCI device list lock when removing an element. MFC after: 1 week --- sys/compat/linuxkpi/common/src/linux_pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 84a38d875564..c6710674feae 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -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);