ACPI / power: Release resource_lock after acpi_power_get_state() return error
authorLan Tianyu <tianyu.lan@intel.com>
Tue, 15 Oct 2013 11:48:11 +0000 (19:48 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 15 Oct 2013 22:26:42 +0000 (00:26 +0200)
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>
drivers/acpi/power.c

index 0dbe5cdf3396e5f53b23c84bb30041329544774d..0c1c3ec784fb319af3c37c7d7c6f60960a6b23ed 100644 (file)
@@ -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) {