Skip to content

Commit

Permalink
ACPI / power: Release resource_lock after acpi_power_get_state() retu…
Browse files Browse the repository at this point in the history
…rn 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>
  • Loading branch information
Lan Tianyu authored and Rafael J. Wysocki committed Oct 15, 2013
1 parent 35f9162 commit d7d4901
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/acpi/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d7d4901

Please sign in to comment.