ACPICA: Fix a regression in the acpi_evaluate_object_type() interface
authorBob Moore <robert.moore@intel.com>
Wed, 3 Jan 2018 23:06:22 +0000 (15:06 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 5 Jan 2018 00:33:22 +0000 (01:33 +0100)
ACPICA commit 9ab548ef154b992208524d61770caca90a9762be

The optional Pathname parameter inadvertently became required.
Introduced in April 2017.

Link: https://github.com/acpica/acpica/commit/9ab548ef
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/nsxfeval.c

index 783f4c838aee4c1daabdea8ac8d6f21e75060492..9b51f65823b2946893e97cf1d0c9926d0c996e12 100644 (file)
@@ -61,10 +61,10 @@ static void acpi_ns_resolve_references(struct acpi_evaluate_info *info);
  *
  * PARAMETERS:  handle              - Object handle (optional)
  *              pathname            - Object pathname (optional)
- *              external_params     - List of parameters to pass to method,
+ *              external_params     - List of parameters to pass to method,
  *                                    terminated by NULL. May be NULL
  *                                    if no parameters are being passed.
- *              return_buffer       - Where to put method's return value (if
+ *              return_buffer       - Where to put the object's return value (if
  *                                    any). If NULL, no value is returned.
  *              return_type         - Expected type of return object
  *
@@ -100,13 +100,14 @@ acpi_evaluate_object_typed(acpi_handle handle,
                free_buffer_on_error = TRUE;
        }
 
+       /* Get a handle here, in order to build an error message if needed */
+
+       target_handle = handle;
        if (pathname) {
                status = acpi_get_handle(handle, pathname, &target_handle);
                if (ACPI_FAILURE(status)) {
                        return_ACPI_STATUS(status);
                }
-       } else {
-               target_handle = handle;
        }
 
        full_pathname = acpi_ns_get_external_pathname(target_handle);