]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix the bug in PeiServicesInstallFvInfoPpi() implementation that can't set the reliab...
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Sep 2009 08:24:05 +0000 (08:24 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Sep 2009 08:24:05 +0000 (08:24 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9255 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/PeiServicesLib/PeiServicesLib.c

index a6f7de2a865170a098a094680be1795caafa7c06..5782e5132ff811bc1a56996363bfbd4588d7daee 100644 (file)
@@ -553,9 +553,13 @@ PeiServicesInstallFvInfoPpi (
   EFI_STATUS                       Status;   \r
   EFI_PEI_FIRMWARE_VOLUME_INFO_PPI *FvInfoPpi;\r
   EFI_PEI_PPI_DESCRIPTOR           *FvInfoPpiDescriptor;\r
+  EFI_GUID                         *ParentFvNameValue;\r
+  EFI_GUID                         *ParentFileNameValue;\r
 \r
+  ParentFvNameValue   = NULL;\r
+  ParentFileNameValue = NULL;\r
   FvInfoPpi = AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI));\r
-  ASSERT( FvInfoPpi != NULL);\r
+  ASSERT(FvInfoPpi != NULL);\r
 \r
   if (FvFormat != NULL) {\r
     CopyGuid (&FvInfoPpi->FvFormat, FvFormat);\r
@@ -564,9 +568,16 @@ PeiServicesInstallFvInfoPpi (
   }\r
   FvInfoPpi->FvInfo = (VOID *) FvInfo;\r
   FvInfoPpi->FvInfoSize = FvInfoSize;\r
-  FvInfoPpi->ParentFvName = (EFI_GUID *) ParentFvName;\r
-  FvInfoPpi->ParentFileName = (EFI_GUID *) ParentFileName;\r
-\r
+  if (ParentFvName != NULL) {\r
+    ParentFvNameValue = AllocateCopyPool (sizeof (EFI_GUID), ParentFvName);\r
+       ASSERT (ParentFvNameValue != NULL);\r
+    FvInfoPpi->ParentFvName = ParentFvNameValue;\r
+  }\r
+  if (ParentFileName != NULL) {\r
+    ParentFileNameValue = AllocateCopyPool (sizeof (EFI_GUID), ParentFileName);\r
+    ASSERT (ParentFileNameValue != NULL);\r
+    FvInfoPpi->ParentFileName = ParentFileNameValue;\r
+  }\r
 \r
   FvInfoPpiDescriptor = AllocateCopyPool (sizeof(EFI_PEI_PPI_DESCRIPTOR), mPpiListTemplate);\r
   ASSERT (FvInfoPpiDescriptor != NULL);\r