From c9f02a96d8a48844e7168e7572b8a1382c2bfd29 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Thu, 1 Mar 2018 13:40:48 +0800 Subject: [PATCH] MdeModulePkg/DxeCorePerfLib: Add status check instead of ASSERT Currently DxeCorePerformanceLib will get SMM performance data based on SMM communication handler. If SMM communication handler returns error, the library will ASSERT. In fact, if SMM perf data is not found. DXE perf data can still be dumped. So using status check instead of ASSERT is better. Cc: Liming Gao Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi Reviewed-by: Liming Gao --- .../Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index 9b3224ef6f..71d624fc9c 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -283,9 +283,8 @@ AllocateBootPerformanceTable ( SmmCommData->Function = SMM_FPDT_FUNCTION_GET_BOOT_RECORD_SIZE; SmmCommData->BootRecordData = NULL; Status = Communication->Communicate (Communication, SmmBootRecordCommBuffer, &CommSize); - ASSERT_EFI_ERROR (Status); - if (!EFI_ERROR (SmmCommData->ReturnStatus) && SmmCommData->BootRecordSize != 0) { + if (!EFI_ERROR (Status) && !EFI_ERROR (SmmCommData->ReturnStatus) && SmmCommData->BootRecordSize != 0) { // // Get all boot records // @@ -317,7 +316,7 @@ AllocateBootPerformanceTable ( // Boot Performance table includes BasicBoot record, and one or more appended Boot Records. // BootPerformanceDataSize = sizeof (BOOT_PERFORMANCE_TABLE) + mPerformanceLength + PcdGet32 (PcdExtFpdtBootRecordPadSize); - if (SmmCommData != NULL) { + if (SmmCommData != NULL && SmmBootRecordData != NULL) { BootPerformanceDataSize += SmmBootRecordDataSize; }