summaryrefslogtreecommitdiff
path: root/MdePkg/Library
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library')
-rw-r--r--MdePkg/Library/PeiServicesLib/PeiServicesLib.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c
index a6f7de2a86..5782e5132f 100644
--- a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c
+++ b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c
@@ -553,9 +553,13 @@ PeiServicesInstallFvInfoPpi (
EFI_STATUS Status;
EFI_PEI_FIRMWARE_VOLUME_INFO_PPI *FvInfoPpi;
EFI_PEI_PPI_DESCRIPTOR *FvInfoPpiDescriptor;
+ EFI_GUID *ParentFvNameValue;
+ EFI_GUID *ParentFileNameValue;
+ ParentFvNameValue = NULL;
+ ParentFileNameValue = NULL;
FvInfoPpi = AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI));
- ASSERT( FvInfoPpi != NULL);
+ ASSERT(FvInfoPpi != NULL);
if (FvFormat != NULL) {
CopyGuid (&FvInfoPpi->FvFormat, FvFormat);
@@ -564,9 +568,16 @@ PeiServicesInstallFvInfoPpi (
}
FvInfoPpi->FvInfo = (VOID *) FvInfo;
FvInfoPpi->FvInfoSize = FvInfoSize;
- FvInfoPpi->ParentFvName = (EFI_GUID *) ParentFvName;
- FvInfoPpi->ParentFileName = (EFI_GUID *) ParentFileName;
-
+ if (ParentFvName != NULL) {
+ ParentFvNameValue = AllocateCopyPool (sizeof (EFI_GUID), ParentFvName);
+ ASSERT (ParentFvNameValue != NULL);
+ FvInfoPpi->ParentFvName = ParentFvNameValue;
+ }
+ if (ParentFileName != NULL) {
+ ParentFileNameValue = AllocateCopyPool (sizeof (EFI_GUID), ParentFileName);
+ ASSERT (ParentFileNameValue != NULL);
+ FvInfoPpi->ParentFileName = ParentFileNameValue;
+ }
FvInfoPpiDescriptor = AllocateCopyPool (sizeof(EFI_PEI_PPI_DESCRIPTOR), mPpiListTemplate);
ASSERT (FvInfoPpiDescriptor != NULL);