提交 12b3b5af 编写于 作者: R Rafael J. Wysocki 提交者: Len Brown

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: NRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 212967c6
...@@ -213,11 +213,13 @@ static int acpi_power_on(acpi_handle handle) ...@@ -213,11 +213,13 @@ static int acpi_power_on(acpi_handle handle)
resource->name)); resource->name));
} else { } else {
result = __acpi_power_on(resource); result = __acpi_power_on(resource);
if (result)
resource->ref_count--;
} }
mutex_unlock(&resource->resource_lock); mutex_unlock(&resource->resource_lock);
return 0; return result;
} }
static int acpi_power_off_device(acpi_handle handle) static int acpi_power_off_device(acpi_handle handle)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册