Skip to content

Commit

Permalink
Removed more codeql fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kenlautner committed Sep 20, 2023
1 parent 6c833b7 commit f25ee56
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxeMm.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PublishPeiTestPoint (
if (Hob.Raw == NULL) {
return ;
}
TestPoint = GET_GUID_HOB_DATA (Hob);
TestPoint = GET_GUID_HOB_DATA (Hob);
TestPointSize = GET_GUID_HOB_DATA_SIZE (Hob);

TestPointLibSetTable (TestPoint, TestPointSize);
Expand Down Expand Up @@ -109,10 +109,8 @@ GetTestPointDataMm (
break;
}
}

Entry = (EFI_MEMORY_DESCRIPTOR *)((UINT8 *)Entry + PiSmmCommunicationRegionTable->DescriptorSize);
}

ASSERT(Index < PiSmmCommunicationRegionTable->NumberOfEntries);
CommBuffer = (UINT8 *)(UINTN)Entry->PhysicalStart;

Expand All @@ -121,11 +119,11 @@ GetTestPointDataMm (
//
CommHeader = (EFI_MM_COMMUNICATE_HEADER *)&CommBuffer[0];
CopyMem(&CommHeader->HeaderGuid, &gAdapterInfoPlatformTestPointGuid, sizeof(gAdapterInfoPlatformTestPointGuid));
CommHeader->MessageLength = sizeof (MMI_HANDLER_TEST_POINT_PARAMETER_GET_INFO);
CommHeader->MessageLength = sizeof(MMI_HANDLER_TEST_POINT_PARAMETER_GET_INFO);

CommGetInfo = (MMI_HANDLER_TEST_POINT_PARAMETER_GET_INFO *)&CommBuffer[OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data)];
CommGetInfo->Header.Command = MMI_HANDLER_TEST_POINT_COMMAND_GET_INFO;
CommGetInfo->Header.DataLength = sizeof (*CommGetInfo);
CommGetInfo->Header.DataLength = sizeof(*CommGetInfo);
CommGetInfo->Header.ReturnStatus = (UINT64)-1;
CommGetInfo->DataSize = 0;

Expand Down Expand Up @@ -160,7 +158,7 @@ GetTestPointDataMm (

CommGetData = (MMI_HANDLER_TEST_POINT_PARAMETER_GET_DATA_BY_OFFSET *)&CommBuffer[OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data)];
CommGetData->Header.Command = MMI_HANDLER_TEST_POINT_COMMAND_GET_DATA_BY_OFFSET;
CommGetData->Header.DataLength = sizeof (*CommGetData);
CommGetData->Header.DataLength = sizeof(*CommGetData);
CommGetData->Header.ReturnStatus = (UINT64)-1;

// Set comm size to the size of the comm header plus the size of the information we are trying to get
Expand Down Expand Up @@ -224,7 +222,6 @@ PublishMmTestPoint (
if (mMmTestPointDatabaseSize == 0) {
return ;
}

if (mMmTestPointDatabase == NULL) {
return ;
}
Expand Down

0 comments on commit f25ee56

Please sign in to comment.