summaryrefslogtreecommitdiff
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-03 23:38:15 (GMT)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-05 16:40:32 (GMT)
commit146fc68a4bdd78e49d56f1530f6b8072034cf3ef (patch)
tree7171b5f6fd8fa8e2e13470e4a3b3867397424e1c /drivers/pci/hotplug
parent454481adf54417ef59b97e92ccb3dc69f3cd02c7 (diff)
downloadlinux-146fc68a4bdd78e49d56f1530f6b8072034cf3ef.tar.xz
ACPI / hotplug / PCI: Simplify register_slot()
The err label in register_slot() is only jumped to from one place, so move the code under the label to that place and drop the label. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 4bc716b..c97454c 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -335,8 +335,10 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
slot = kzalloc(sizeof(struct acpiphp_slot), GFP_KERNEL);
if (!slot) {
- status = AE_NO_MEMORY;
- goto err;
+ mutex_lock(&acpiphp_context_lock);
+ acpiphp_put_context(context);
+ mutex_unlock(&acpiphp_context_lock);
+ return AE_NO_MEMORY;
}
slot->bus = bridge->pci_bus;
@@ -404,12 +406,6 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
}
return AE_OK;
-
- err:
- mutex_lock(&acpiphp_context_lock);
- acpiphp_put_context(context);
- mutex_unlock(&acpiphp_context_lock);
- return status;
}
static struct acpiphp_bridge *acpiphp_handle_to_bridge(acpi_handle handle)