]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeSupport.c
Reviewed the code comments in the Include/Protocol directory for typos, grammar issue...
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / DxeReportStatusCodeLibFramework / DxeSupport.c
index 42f7699e225b4b9d2e71b2fb2a4c7e6c4e6c8642..bfa5e513056218ea141434e7963e31f1f5f167d6 100644 (file)
@@ -30,7 +30,7 @@ InternalGetReportStatusCode (
 \r
   if (gRT->Hdr.Revision < 0x20000) {\r
     return ((FRAMEWORK_EFI_RUNTIME_SERVICES*)gRT)->ReportStatusCode;\r
-  } else if (gBS != NULL) {\r
+  } else if (gBS != NULL && gBS->LocateProtocol != NULL) {\r
     Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, (VOID**)&StatusCodeProtocol);\r
     if (!EFI_ERROR (Status) && StatusCodeProtocol != NULL) {\r
       return StatusCodeProtocol->ReportStatusCode;\r
@@ -99,7 +99,7 @@ InternalReportStatusCodeEx (
   ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));\r
   ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));\r
 \r
-  if (gBS == NULL) {\r
+  if (gBS == NULL || gBS->AllocatePool == NULL || gBS->FreePool == NULL) {\r
     return EFI_UNSUPPORTED;\r
   }\r
 \r
@@ -125,7 +125,9 @@ InternalReportStatusCodeEx (
   //\r
   // Fill in the extended data buffer\r
   //\r
-  CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);\r
+  if (ExtendedData != NULL) {\r
+    CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);\r
+  }\r
 \r
   //\r
   // Report the status code\r