Skip to content

Commit ddcd0fd

Browse files
mikebeatonmergify[bot]
authored andcommitted
DynamicTablesPkg/AmlLib: Fix refactor AmlCodeGenInvokeMethod API
CLANG CI shows that ArgCountNode can be used uninitialized. This is a genuine error, it should be NULL-ed before any `goto exit_handler`. Fixes: 1774a34 Signed-off-by: Mike Beaton <[email protected]>
1 parent 23c1cb8 commit ddcd0fd

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

DynamicTablesPkg/Library/Common/AmlLib/CodeGen/AmlCodeGen.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4028,6 +4028,7 @@ AmlCodeGenInvokeMethod (
40284028
}
40294029

40304030
MethodInvocationNode = NULL;
4031+
ArgCountNode = NULL;
40314032

40324033
NodeStream = AllocateZeroPool (sizeof (AML_NODE_HANDLE) * (NumArgs + 1));
40334034
if (NodeStream == NULL) {
@@ -4167,13 +4168,12 @@ AmlCodeGenInvokeMethod (
41674168
goto exit_handler;
41684169
}
41694170

4170-
ArgCountNode = NULL;
4171-
Status = AmlCreateDataNode (
4172-
EAmlNodeDataTypeUInt,
4173-
&NumArgs,
4174-
sizeof (UINT8),
4175-
&ArgCountNode
4176-
);
4171+
Status = AmlCreateDataNode (
4172+
EAmlNodeDataTypeUInt,
4173+
&NumArgs,
4174+
sizeof (UINT8),
4175+
&ArgCountNode
4176+
);
41774177
if (EFI_ERROR (Status)) {
41784178
ASSERT_EFI_ERROR (Status);
41794179
goto exit_handler;

0 commit comments

Comments
 (0)