Hi Pierre, Thank you for this patch.
Reviewed-by: Sami Mujawar <[email protected]> Regards, Sami Mujawar On 07/10/2021 04:31 PM, [email protected] wrote:
From: Pierre Gondois <[email protected]> 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. Signed-off-by: Pierre Gondois <[email protected]> --- DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c | 6 +----- DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlClone.c | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c index 4775b68cd974..cbfd9cbb68b6 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c @@ -148,7 +148,6 @@ AmlCodeGenString ( return EFI_INVALID_PARAMETER; } - ObjectNode = NULL; DataNode = NULL; Status = AmlCreateObjectNode ( @@ -187,10 +186,7 @@ AmlCodeGenString ( return Status; error_handler: - if (ObjectNode != NULL) { - AmlDeleteTree ((AML_NODE_HEADER*)ObjectNode); - } - + AmlDeleteTree ((AML_NODE_HEADER*)ObjectNode); return Status; } diff --git a/DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlClone.c b/DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlClone.c index e09372b039f1..7aafa957a8c4 100644 --- a/DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlClone.c +++ b/DynamicTablesPkg/Library/Common/AmlLib/Tree/AmlClone.c @@ -43,8 +43,6 @@ AmlCloneNode ( return EFI_INVALID_PARAMETER; } - *ClonedNode = NULL; - if (IS_AML_DATA_NODE (Node)) { DataNode = (AML_DATA_NODE*)Node; Status = AmlCreateDataNode (
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81680): https://edk2.groups.io/g/devel/message/81680 Mute This Topic: https://groups.io/mt/86148198/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
