]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Hold pci_slot_mutex while searching bus->slots list
authorYijing Wang <wangyijing@huawei.com>
Fri, 17 Jul 2015 09:16:32 +0000 (17:16 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 30 Jul 2015 21:19:53 +0000 (16:19 -0500)
commit7c1348653332ed2b764df4808582e51e5904a7fe
treee15b309ad6ebf5322bb3c2a54ba244750dd57c0b
parenta0eb89f3b0af1801cce86918720e2c2f2072b9e8
PCI: Hold pci_slot_mutex while searching bus->slots list

Previously, pci_setup_device() and similar functions searched the
pci_bus->slots list without any locking.  It was possible for another
thread to update the list while we searched it.

Add pci_dev_assign_slot() to search the list while holding pci_slot_mutex.

[bhelgaas: changelog, fold in CONFIG_SYSFS fix]
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/powerpc/kernel/pci_of_scan.c
arch/sparc/kernel/pci.c
drivers/pci/probe.c
drivers/pci/slot.c
include/linux/pci.h