summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/psxface.c
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2003-12-09 02:45:16 +0000
committernjl <njl@FreeBSD.org>2003-12-09 02:45:16 +0000
commit2a9caa496cc3521e5c9352c255b827c90efb3839 (patch)
tree24e5ad5d8b4fb5681ddaa34c6ae30814c80ffe56 /sys/contrib/dev/acpica/psxface.c
parentdc49a5b908c59c6ae7c8b069908225dd6c21c041 (diff)
downloadFreeBSD-src-2a9caa496cc3521e5c9352c255b827c90efb3839.zip
FreeBSD-src-2a9caa496cc3521e5c9352c255b827c90efb3839.tar.gz
Import ACPI-CA 20031203
Diffstat (limited to 'sys/contrib/dev/acpica/psxface.c')
-rw-r--r--sys/contrib/dev/acpica/psxface.c39
1 files changed, 30 insertions, 9 deletions
diff --git a/sys/contrib/dev/acpica/psxface.c b/sys/contrib/dev/acpica/psxface.c
index 4f8795a..05ad58a 100644
--- a/sys/contrib/dev/acpica/psxface.c
+++ b/sys/contrib/dev/acpica/psxface.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psxface - Parser external interfaces
- * $Revision: 68 $
+ * $Revision: 69 $
*
*****************************************************************************/
@@ -207,7 +207,8 @@ AcpiPsxExecute (
Op = AcpiPsCreateScopeOp ();
if (!Op)
{
- return_ACPI_STATUS (AE_NO_MEMORY);
+ Status = AE_NO_MEMORY;
+ goto Cleanup1;
}
/*
@@ -223,21 +224,26 @@ AcpiPsxExecute (
NULL, NULL, NULL);
if (!WalkState)
{
- return_ACPI_STATUS (AE_NO_MEMORY);
+ Status = AE_NO_MEMORY;
+ goto Cleanup2;
}
Status = AcpiDsInitAmlWalk (WalkState, Op, MethodNode, ObjDesc->Method.AmlStart,
ObjDesc->Method.AmlLength, NULL, NULL, 1);
if (ACPI_FAILURE (Status))
{
- AcpiDsDeleteWalkState (WalkState);
- return_ACPI_STATUS (Status);
+ goto Cleanup3;
}
/* Parse the AML */
Status = AcpiPsParseAml (WalkState);
AcpiPsDeleteParseTree (Op);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Cleanup1; /* Walk state is already deleted */
+
+ }
/*
* 2) Execute the method. Performs second pass parse simultaneously
@@ -251,7 +257,8 @@ AcpiPsxExecute (
Op = AcpiPsCreateScopeOp ();
if (!Op)
{
- return_ACPI_STATUS (AE_NO_MEMORY);
+ Status = AE_NO_MEMORY;
+ goto Cleanup1;
}
/* Init new op with the method name and pointer back to the NS node */
@@ -264,23 +271,32 @@ AcpiPsxExecute (
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
if (!WalkState)
{
- return_ACPI_STATUS (AE_NO_MEMORY);
+ Status = AE_NO_MEMORY;
+ goto Cleanup2;
}
Status = AcpiDsInitAmlWalk (WalkState, Op, MethodNode, ObjDesc->Method.AmlStart,
ObjDesc->Method.AmlLength, Params, ReturnObjDesc, 3);
if (ACPI_FAILURE (Status))
{
- AcpiDsDeleteWalkState (WalkState);
- return_ACPI_STATUS (Status);
+ goto Cleanup3;
}
/*
* The walk of the parse tree is where we actually execute the method
*/
Status = AcpiPsParseAml (WalkState);
+ goto Cleanup2; /* Walk state already deleted */
+
+
+
+Cleanup3:
+ AcpiDsDeleteWalkState (WalkState);
+
+Cleanup2:
AcpiPsDeleteParseTree (Op);
+Cleanup1:
if (Params)
{
/* Take away the extra reference that we gave the parameters above */
@@ -293,6 +309,11 @@ AcpiPsxExecute (
}
}
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+
/*
* If the method has returned an object, signal this to the caller with
* a control exception code
OpenPOWER on IntegriCloud