[PATCH v3 2/6] DynamicTablesPkg: DynamicPlatRepoLib: Fix incorrect dereferencing

Kun Qin

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3996

The content of token should be derived from the data section of the
`CmObject` instead of the object itself.

This change fixed the issue by dereferencing the token value from the
data buffer of input CmObject.

Cc: Sami Mujawar <Sami.Mujawar@...>
Cc: Alexei Fedorov <Alexei.Fedorov@...>

Co-authored-by: Joe Lopez <joelopez@...>
Signed-off-by: Kun Qin <kuqin12@...>
Reviewed-by: Sami Mujawar <sami.mujawar@...>
Reviewed-by: Pierre Gondois <pierre.gondois@...>

- Added Reviewed-by tag [Sami]
- Added Reviewed-by tag [Pierre]
- No change.

DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer.c | =
2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTok=
enFixer.c b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectToke=
index 80d0aa17bc1a..84e4bb7e3bc8 100644
--- a/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer=
+++ b/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/CmObjectTokenFixer=
@@ -60,7 +60,7 @@ TokenFixerItsGroup (
ASSERT (CmObject !=3D NULL);=0D
- ((CM_ARM_ITS_GROUP_NODE *)CmObject)->Token =3D Token;=0D
+ ((CM_ARM_ITS_GROUP_NODE *)CmObject->Data)->Token =3D Token;=0D
return EFI_SUCCESS;=0D

Join {devel@edk2.groups.io to automatically receive all group messages.