diff options
author | Guenter Roeck <linux@roeck-us.net> | 2015-11-01 16:58:40 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2015-11-25 12:45:42 -0500 |
commit | 64609eaab242d36e3e3b7cb81d31a028719feb74 (patch) | |
tree | 54d8bbdcaa70a0a5bdc4e0c7d02a3c098ea02654 | |
parent | 1ec218373b8ebda821aec00bb156a9c94fad9cd4 (diff) |
PCI: pciehp: Always protect pciehp_disable_slot() with hotplug mutex
When called from pciehp_sysfs_disable_slot(), the call to
pciehp_disable_slot() was not protected by the hotplug mutex.
Hold slot->hotplug_lock while calling pciehp_disable_slot().
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rajat Jain <rajatxjain@gmail.com>
-rw-r--r-- | drivers/pci/hotplug/pciehp_ctrl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 4c8f4cde6854..880978b6d534 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -511,7 +511,9 @@ int pciehp_sysfs_disable_slot(struct slot *p_slot) | |||
511 | case STATIC_STATE: | 511 | case STATIC_STATE: |
512 | p_slot->state = POWEROFF_STATE; | 512 | p_slot->state = POWEROFF_STATE; |
513 | mutex_unlock(&p_slot->lock); | 513 | mutex_unlock(&p_slot->lock); |
514 | mutex_lock(&p_slot->hotplug_lock); | ||
514 | retval = pciehp_disable_slot(p_slot); | 515 | retval = pciehp_disable_slot(p_slot); |
516 | mutex_unlock(&p_slot->hotplug_lock); | ||
515 | mutex_lock(&p_slot->lock); | 517 | mutex_lock(&p_slot->lock); |
516 | p_slot->state = STATIC_STATE; | 518 | p_slot->state = STATIC_STATE; |
517 | break; | 519 | break; |