Commit 9b40eebc authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPICA: Fix acpi_evaluate_object_typed()

Commit 2d2a9543 (ACPICA: Update two error messages to emit
control method name) causes acpi_evaluate_object_typed() to fail
if its pathname argument is NULL, but some callers of that function
in the kernel, particularly acpi_nondev_subnode_data_ok(), pass
NULL as pathname to it and expect it to work.

For this reason, make acpi_evaluate_object_typed() check if its
pathname argument is NULL and fall back to using the pathname of
its handle argument if that is the case.
Reported-by: default avatarSakari Ailus <sakari.ailus@intel.com>
Tested-by: default avatarYang, Hyungwoo <hyungwoo.yang@intel.com>
Fixes: 2d2a9543 (ACPICA: Update two error messages to emit control method name)
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 14ccee78
...@@ -100,10 +100,14 @@ acpi_evaluate_object_typed(acpi_handle handle, ...@@ -100,10 +100,14 @@ acpi_evaluate_object_typed(acpi_handle handle,
free_buffer_on_error = TRUE; free_buffer_on_error = TRUE;
} }
if (pathname) {
status = acpi_get_handle(handle, pathname, &target_handle); status = acpi_get_handle(handle, pathname, &target_handle);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status); return_ACPI_STATUS(status);
} }
} else {
target_handle = handle;
}
full_pathname = acpi_ns_get_external_pathname(target_handle); full_pathname = acpi_ns_get_external_pathname(target_handle);
if (!full_pathname) { if (!full_pathname) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment