Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jul 2017 00:02:06 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320627 - head/sys/compat/linuxkpi/common/src
Message-ID:  <201707040002.v64026ll082757@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Jul  4 00:02:06 2017
New Revision: 320627
URL: https://svnweb.freebsd.org/changeset/base/320627

Log:
  Hold the PCI device list lock when removing an element.
  
  MFC after:	1 week

Modified:
  head/sys/compat/linuxkpi/common/src/linux_pci.c

Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_pci.c	Tue Jul  4 00:00:42 2017	(r320626)
+++ head/sys/compat/linuxkpi/common/src/linux_pci.c	Tue Jul  4 00:02:06 2017	(r320627)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707040002.v64026ll082757>