diff options
Diffstat (limited to 'sys/contrib/dev/acpica/psxface.c')
-rw-r--r-- | sys/contrib/dev/acpica/psxface.c | 39 |
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 |