]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2017 07:35:52 +0000 (09:35 +0200)
commit0544aab81d35a0ec852eb63a5e6bfa6eac132848
tree9ec34e4bce40ef90e7345c913c6c175879612aad
parent6ad74630c016ef823f2720671ee4db641d35fd2c
PCI: Fix race condition with driver_override

commit 9561475db680f7144d2223a409dd3d7e322aca03 upstream.

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 6265539776a0 ("driver core: platform:
fix race condition with driver_override") from Adrian Salido.

Fixes: 782a985d7af2 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/pci-sysfs.c