Skip to content

Commit

Permalink
ACPI / PM: Do not refcount power resources that can't be turned on
Browse files Browse the repository at this point in the history
If turning on a power resource fails, do not reference count it,
since it cannot be in use in that case.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Rafael J. Wysocki authored and Len Brown committed Dec 1, 2010
1 parent 212967c commit 12b3b5a
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 @@ -213,11 +213,13 @@ static int acpi_power_on(acpi_handle handle)
resource->name));
} else {
result = __acpi_power_on(resource);
if (result)
resource->ref_count--;
}

mutex_unlock(&resource->resource_lock);

return 0;
return result;
}

static int acpi_power_off_device(acpi_handle handle)
Expand Down

0 comments on commit 12b3b5a

Please sign in to comment.