summaryrefslogtreecommitdiff
path: root/source/components/namespace/nsxfeval.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/namespace/nsxfeval.c')
-rw-r--r--source/components/namespace/nsxfeval.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/source/components/namespace/nsxfeval.c b/source/components/namespace/nsxfeval.c
index 4dd8ff1d2fe4..ab3ad5988549 100644
--- a/source/components/namespace/nsxfeval.c
+++ b/source/components/namespace/nsxfeval.c
@@ -199,6 +199,8 @@ AcpiEvaluateObjectTyped (
{
ACPI_STATUS Status;
BOOLEAN FreeBufferOnError = FALSE;
+ ACPI_HANDLE TargetHandle;
+ char *FullPathname;
ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
@@ -216,41 +218,56 @@ AcpiEvaluateObjectTyped (
FreeBufferOnError = TRUE;
}
+ Status = AcpiGetHandle (Handle, Pathname, &TargetHandle);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
+ FullPathname = AcpiNsGetExternalPathname (TargetHandle);
+ if (!FullPathname)
+ {
+ return_ACPI_STATUS (AE_NO_MEMORY);
+ }
+
/* Evaluate the object */
- Status = AcpiEvaluateObject (Handle, Pathname,
- ExternalParams, ReturnBuffer);
+ Status = AcpiEvaluateObject (TargetHandle, NULL, ExternalParams,
+ ReturnBuffer);
if (ACPI_FAILURE (Status))
{
- return_ACPI_STATUS (Status);
+ goto Exit;
}
- /* Type ANY means "don't care" */
+ /* Type ANY means "don't care about return value type" */
if (ReturnType == ACPI_TYPE_ANY)
{
- return_ACPI_STATUS (AE_OK);
+ goto Exit;
}
if (ReturnBuffer->Length == 0)
{
/* Error because caller specifically asked for a return value */
- ACPI_ERROR ((AE_INFO, "No return value"));
- return_ACPI_STATUS (AE_NULL_OBJECT);
+ ACPI_ERROR ((AE_INFO, "%s did not return any object",
+ FullPathname));
+ Status = AE_NULL_OBJECT;
+ goto Exit;
}
/* Examine the object type returned from EvaluateObject */
if (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type == ReturnType)
{
- return_ACPI_STATUS (AE_OK);
+ goto Exit;
}
/* Return object type does not match requested type */
ACPI_ERROR ((AE_INFO,
- "Incorrect return type [%s] requested [%s]",
+ "Incorrect return type from %s - received [%s], requested [%s]",
+ FullPathname,
AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type),
AcpiUtGetTypeName (ReturnType)));
@@ -268,7 +285,11 @@ AcpiEvaluateObjectTyped (
}
ReturnBuffer->Length = 0;
- return_ACPI_STATUS (AE_TYPE);
+ Status = AE_TYPE;
+
+Exit:
+ ACPI_FREE (FullPathname);
+ return_ACPI_STATUS (Status);
}
ACPI_EXPORT_SYMBOL (AcpiEvaluateObjectTyped)