]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Fix race condition with driver_override
authorNicolai Stange <nstange@suse.de>
Mon, 11 Sep 2017 07:45:40 +0000 (09:45 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 25 Sep 2017 23:34:54 +0000 (18:34 -0500)
commit7787dca824b0c6e7325c00004ffc1f6d50841278
tree34aa91f19f3c51bd13402386634f00ac38031371
parent963346d613c5c21dd42ebce8a69b9297aed89cce
PCI: Fix race condition with driver_override

The driver_override implementation is susceptible to a race condition when
different threads are reading vs. storing a different driver override.  Add
locking to avoid the race condition.

This is in close analogy to commit 3e0f717452a9 ("driver core: platform:
fix race condition with driver_override") from Adrian Salido.

Fixes: dbb735495ebe ("PCI: Introduce new device binding path using pci_dev.driver_override")
Signed-off-by: Nicolai Stange <nstange@suse.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org # v3.16+
drivers/pci/pci-sysfs.c