summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-09-10 08:24:05 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-09-10 08:24:05 +0000
commit3831f3e9a921eb7b8dbfcaf06acdf9eef9127204 (patch)
treed1e1328fe4b7e8398facb6dc8de5236c1aa99a61
parented5ac057bf96aded5612c6333918953238088de5 (diff)
downloadedk2-platforms-3831f3e9a921eb7b8dbfcaf06acdf9eef9127204.tar.xz
Fix the bug in PeiServicesInstallFvInfoPpi() implementation that can't set the reliable ParentFvName and ParentFileName when install FvInfo PPI.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9255 6f19259b-4bc3-4df7-8a09-765794883524
-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);