summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/power.c
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2013-10-15 13:48:11 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-16 00:26:42 +0200
commitd7d49012b917647794b6df33f4e7a61a2c818ccf (patch)
treee4462bfb43a179b578320b7b931d342fbc272bfc /drivers/acpi/power.c
parentMerge tag 'pm+acpi-3.12-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff)
downloadlinux-d7d49012b917647794b6df33f4e7a61a2c818ccf.tar.xz
linux-d7d49012b917647794b6df33f4e7a61a2c818ccf.zip
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) {