ACPI / PCI / hotplug: unlock in error path in acpiphp_enable_slot()
authorInsu Yun <wuninsu@gmail.com>
Sat, 23 Jan 2016 20:44:19 +0000 (15:44 -0500)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 24 Jan 2016 01:09:03 +0000 (02:09 +0100)
In acpiphp_enable_slot(), there is a missing unlock path
when error occurred.  It needs to be unlocked before returning
an error.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/pci/hotplug/acpiphp_glue.c

index ff538568a61774af57290eac6b27cd6ea9457908..0b3e0bfa7be5d505dffbcc5cef190be0ce1caaaa 100644 (file)
@@ -953,8 +953,10 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
 {
        pci_lock_rescan_remove();
 
-       if (slot->flags & SLOT_IS_GOING_AWAY)
+       if (slot->flags & SLOT_IS_GOING_AWAY) {
+               pci_unlock_rescan_remove();
                return -ENODEV;
+       }
 
        /* configure all functions */
        if (!(slot->flags & SLOT_ENABLED))