ACPI / PM: Do not refcount power resources that can't be turned on
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>
This commit is contained in:
parent
212967c69a
commit
12b3b5afed
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user