summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2013-02-27 03:01:40 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2013-02-27 03:01:40 +0000
commit0b1ef27500a2c5cb5ea248d808dd73cc90335d7f (patch)
treeb780afeca4b00ad804f9d42daa3b0c8aecb63439 /MdeModulePkg
parente8654a1a1ad6d70f353ea60a78fb92aefa7dfb32 (diff)
downloadedk2-0b1ef27500a2c5cb5ea248d808dd73cc90335d7f.tar.gz
edk2-0b1ef27500a2c5cb5ea248d808dd73cc90335d7f.tar.bz2
edk2-0b1ef27500a2c5cb5ea248d808dd73cc90335d7f.zip
Adds ASSERT check in DxePcd driver when error status of read DynamicHii PCD is not EFI_NOT_FOUND to avoid the incorrect value is used.
Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14147 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/PCD/Dxe/Service.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c
index 53780dca9f..6eaadd6cce 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Service.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c
@@ -1,7 +1,7 @@
/** @file
Help functions used by PCD DXE driver.
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -150,6 +150,11 @@ GetWorker (
//
GetPtrTypeSize (TmpTokenNumber, &GetSize);
}
+ //
+ // If the operation is successful, we copy the data
+ // to the default value buffer in the PCD Database.
+ // So that we can free the Data allocated in GetHiiVariable.
+ //
CopyMem (VaraiableDefaultBuffer, Data + VariableHead->Offset, GetSize);
FreePool (Data);
}
@@ -166,19 +171,14 @@ GetWorker (
//
GetPtrTypeSize (TmpTokenNumber, &GetSize);
}
+ //
+ // If the operation is successful, we copy the data
+ // to the default value buffer in the PCD Database.
+ // So that we can free the Data allocated in GetHiiVariable.
+ //
CopyMem (VaraiableDefaultBuffer, Data + VariableHead->Offset, GetSize);
FreePool (Data);
}
- //
- // If the operation is successful, we copy the data
- // to the default value buffer in the PCD Database.
- // So that we can free the Data allocated in GetHiiVariable.
- //
- //
- // If the operation is not successful,
- // Return 1) either the default value specified by Platform Integrator
- // 2) Or the value Set by a PCD set operation.
- //
RetPtr = (VOID *) VaraiableDefaultBuffer;
}
break;
@@ -535,6 +535,12 @@ GetHiiVariable (
ASSERT (Status == EFI_SUCCESS);
*VariableData = Buffer;
*VariableSize = Size;
+ } else {
+ //
+ // Use Default Data only when variable is not found.
+ // For other error status, correct data can't be got, and trig ASSERT().
+ //
+ ASSERT (Status == EFI_NOT_FOUND);
}
return Status;