mirror of
https://github.com/acpica/acpica/
synced 2025-01-18 15:39:18 +03:00
Added error checking after all mutex acquires and most mutex releases.
date 2002.02.12.23.57.00; author rmoore1; state Exp;
This commit is contained in:
parent
ea6b692747
commit
b741f08c1d
@ -1,7 +1,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dsmethod - Parser/Interpreter interface - control method parsing
|
||||
* $Revision: 1.75 $
|
||||
* $Revision: 1.79 $
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
|
||||
* Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
@ -127,7 +127,7 @@
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
MODULE_NAME ("dsmethod")
|
||||
ACPI_MODULE_NAME ("dsmethod")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
@ -160,7 +160,7 @@ AcpiDsParseMethod (
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
|
||||
|
||||
FUNCTION_TRACE_PTR ("DsParseMethod", ObjHandle);
|
||||
ACPI_FUNCTION_TRACE_PTR ("DsParseMethod", ObjHandle);
|
||||
|
||||
|
||||
/* Parameter Validation */
|
||||
@ -211,12 +211,12 @@ AcpiDsParseMethod (
|
||||
AcpiPsSetName (Op, Node->Name);
|
||||
Op->Node = Node;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Get a new OwnerId for objects created by this method. Namespace
|
||||
* objects (such as Operation Regions) can be created during the
|
||||
* first pass parse.
|
||||
*/
|
||||
OwnerId = AcpiUtAllocateOwnerId (OWNER_TYPE_METHOD);
|
||||
OwnerId = AcpiUtAllocateOwnerId (ACPI_OWNER_TYPE_METHOD);
|
||||
ObjDesc->Method.OwningId = OwnerId;
|
||||
|
||||
/* Create and initialize a new walk state */
|
||||
@ -287,7 +287,7 @@ AcpiDsBeginMethodExecution (
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
FUNCTION_TRACE_PTR ("DsBeginMethodExecution", MethodNode);
|
||||
ACPI_FUNCTION_TRACE_PTR ("DsBeginMethodExecution", MethodNode);
|
||||
|
||||
|
||||
if (!MethodNode)
|
||||
@ -360,7 +360,7 @@ AcpiDsCallControlMethod (
|
||||
UINT32 i;
|
||||
|
||||
|
||||
FUNCTION_TRACE_PTR ("DsCallControlMethod", ThisWalkState);
|
||||
ACPI_FUNCTION_TRACE_PTR ("DsCallControlMethod", ThisWalkState);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Execute method %p, currentstate=%p\n",
|
||||
ThisWalkState->PrevOp, ThisWalkState));
|
||||
@ -396,7 +396,6 @@ AcpiDsCallControlMethod (
|
||||
if (!NextWalkState)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Create and init a Root Node */
|
||||
@ -499,7 +498,7 @@ AcpiDsRestartControlMethod (
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
FUNCTION_TRACE_PTR ("DsRestartControlMethod", WalkState);
|
||||
ACPI_FUNCTION_TRACE_PTR ("DsRestartControlMethod", WalkState);
|
||||
|
||||
|
||||
if (ReturnDesc)
|
||||
@ -557,9 +556,10 @@ AcpiDsTerminateControlMethod (
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_NAMESPACE_NODE *MethodNode;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
FUNCTION_TRACE_PTR ("DsTerminateControlMethod", WalkState);
|
||||
ACPI_FUNCTION_TRACE_PTR ("DsTerminateControlMethod", WalkState);
|
||||
|
||||
|
||||
/* The current method object was saved in the walk state */
|
||||
@ -579,7 +579,11 @@ AcpiDsTerminateControlMethod (
|
||||
* If this is the last thread executing the method,
|
||||
* we have additional cleanup to perform
|
||||
*/
|
||||
AcpiUtAcquireMutex (ACPI_MTX_PARSER);
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_PARSER);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Signal completion of the execution of this method if necessary */
|
||||
|
||||
@ -606,7 +610,12 @@ AcpiDsTerminateControlMethod (
|
||||
* Delete any namespace entries created immediately underneath
|
||||
* the method
|
||||
*/
|
||||
AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
if (MethodNode->Child)
|
||||
{
|
||||
AcpiNsDeleteNamespaceSubtree (MethodNode);
|
||||
@ -617,11 +626,15 @@ AcpiDsTerminateControlMethod (
|
||||
* the namespace
|
||||
*/
|
||||
AcpiNsDeleteNamespaceByOwner (WalkState->MethodDesc->Method.OwningId);
|
||||
AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
AcpiUtReleaseMutex (ACPI_MTX_PARSER);
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
Status = AcpiUtReleaseMutex (ACPI_MTX_PARSER);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user