mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
DynamicTablesPkg: Update error handling for node creation
The node creation functions: - AmlCreateRootNode() - AmlCreateObjectNode() - AmlCreateDataNode() are now resetting the input pointer where the created node is stored. Thus, it is not necessary to set some local variables to NULL or check a node value before trying to delete it. Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
This commit is contained in:
parent
2dd7dd3952
commit
37bd08176c
@ -148,7 +148,6 @@ AmlCodeGenString (
|
|||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectNode = NULL;
|
|
||||||
DataNode = NULL;
|
DataNode = NULL;
|
||||||
|
|
||||||
Status = AmlCreateObjectNode (
|
Status = AmlCreateObjectNode (
|
||||||
@ -187,10 +186,7 @@ AmlCodeGenString (
|
|||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
error_handler:
|
error_handler:
|
||||||
if (ObjectNode != NULL) {
|
AmlDeleteTree ((AML_NODE_HEADER*)ObjectNode);
|
||||||
AmlDeleteTree ((AML_NODE_HEADER*)ObjectNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,8 +43,6 @@ AmlCloneNode (
|
|||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
*ClonedNode = NULL;
|
|
||||||
|
|
||||||
if (IS_AML_DATA_NODE (Node)) {
|
if (IS_AML_DATA_NODE (Node)) {
|
||||||
DataNode = (AML_DATA_NODE*)Node;
|
DataNode = (AML_DATA_NODE*)Node;
|
||||||
Status = AmlCreateDataNode (
|
Status = AmlCreateDataNode (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user