diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index 6da0fea971..38c52cc261 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -1047,7 +1047,13 @@ InsertFpdtRecord ( switch (PerfId) { case MODULE_START_ID: case MODULE_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid); + // MU_CHANGE [BEGIN] - CodeQL change + Status = GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to get Module Info from Handle! Status = %r\n", Status)); + } + + // MU_CHANGE [END] - CodeQL change StringPtr = ModuleName; // // Cache the offset of start image start record and use to update the start image end record if needed. @@ -1083,7 +1089,13 @@ InsertFpdtRecord ( case MODULE_LOADIMAGE_START_ID: case MODULE_LOADIMAGE_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid); + // MU_CHANGE [BEGIN] - CodeQL change + Status = GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to get Module Info from Handle! Status = %r\n", Status)); + } + + // MU_CHANGE [END] - CodeQL change StringPtr = ModuleName; if (PerfId == MODULE_LOADIMAGE_START_ID) { mLoadImageCount++; @@ -1126,7 +1138,13 @@ InsertFpdtRecord ( case MODULE_DB_SUPPORT_END_ID: case MODULE_DB_STOP_START_ID: case MODULE_DB_STOP_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid); + // MU_CHANGE [BEGIN] - CodeQL change + Status = GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to get Module Info from Handle! Status = %r\n", Status)); + } + + // MU_CHANGE [END] - CodeQL change StringPtr = ModuleName; if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { FpdtRecordPtr.GuidQwordEvent->Header.Type = FPDT_GUID_QWORD_EVENT_TYPE; @@ -1141,7 +1159,13 @@ InsertFpdtRecord ( break; case MODULE_DB_END_ID: - GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid); + // MU_CHANGE [BEGIN] - CodeQL change + Status = GetModuleInfoFromHandle ((EFI_HANDLE)CallerIdentifier, ModuleName, sizeof (ModuleName), &ModuleGuid); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to get Module Info from Handle! Status = %r\n", Status)); + } + + // MU_CHANGE [END] - CodeQL change StringPtr = ModuleName; if (!PcdGetBool (PcdEdkiiFpdtStringRecordEnableOnly)) { FpdtRecordPtr.GuidQwordStringEvent->Header.Type = FPDT_GUID_QWORD_STRING_EVENT_TYPE;