summaryrefslogtreecommitdiff
path: root/drivers/acpi/power.c
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2013-10-15 15:48:11 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-16 02:26:42 +0400
commitd7d49012b917647794b6df33f4e7a61a2c818ccf (patch)
treee4462bfb43a179b578320b7b931d342fbc272bfc /drivers/acpi/power.c
parent35f9162d67c3e20a82b4bd6ec538f3e9c14fb055 (diff)
downloadlinux-d7d49012b917647794b6df33f4e7a61a2c818ccf.tar.xz
ACPI / power: Release resource_lock after acpi_power_get_state() return error
In acpi_resume_power_resources() resource_lock should be released when acpi_power_get_state() fails and before passing to next power resource on the list. Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/power.c')
-rw-r--r--drivers/acpi/power.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 0dbe5cdf3396..0c1c3ec784fb 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -936,8 +936,10 @@ void acpi_resume_power_resources(void)
mutex_lock(&resource->resource_lock);
result = acpi_power_get_state(resource->device.handle, &state);
- if (result)
+ if (result) {
+ mutex_unlock(&resource->resource_lock);
continue;
+ }
if (state == ACPI_POWER_RESOURCE_STATE_OFF
&& resource->ref_count) {