Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64609eaa authored by Guenter Roeck's avatar Guenter Roeck Committed by Bjorn Helgaas
Browse files

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: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarRajat Jain <rajatxjain@gmail.com>
parent 1ec21837
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -511,7 +511,9 @@ int pciehp_sysfs_disable_slot(struct slot *p_slot)
	case STATIC_STATE:
	case STATIC_STATE:
		p_slot->state = POWEROFF_STATE;
		p_slot->state = POWEROFF_STATE;
		mutex_unlock(&p_slot->lock);
		mutex_unlock(&p_slot->lock);
		mutex_lock(&p_slot->hotplug_lock);
		retval = pciehp_disable_slot(p_slot);
		retval = pciehp_disable_slot(p_slot);
		mutex_unlock(&p_slot->hotplug_lock);
		mutex_lock(&p_slot->lock);
		mutex_lock(&p_slot->lock);
		p_slot->state = STATIC_STATE;
		p_slot->state = STATIC_STATE;
		break;
		break;