diff options
author | Gua Guo <gua.guo@intel.com> | 2022-05-06 05:29:51 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-05-09 11:10:56 +0000 |
commit | a658ed30e51f2b2024d7bf8d2aa8be2dfa0b02a2 (patch) | |
tree | dcfeaf5633a10c967f86c877c90df70fc974e265 | |
parent | 29ae55a0b8194fef2e769f2882297aa601b4777a (diff) | |
download | edk2-a658ed30e51f2b2024d7bf8d2aa8be2dfa0b02a2.zip edk2-a658ed30e51f2b2024d7bf8d2aa8be2dfa0b02a2.tar.gz edk2-a658ed30e51f2b2024d7bf8d2aa8be2dfa0b02a2.tar.bz2 |
MdeModulePkg/PCD: Pcd initialize DXE have assert
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3917
When PlatformPkg.dsc has multiple SKU IDs but didn't exist delta PCD,
System will hang on BuildPcdDxeDataBase.
Ideally, if didn't exist delta PCD by different SKU ID,
UpdatePcdDatabase () shouldn't return EFI_NOT_FOUND.
Signed-off-by: Gua Guo <gua.guo@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
-rw-r--r-- | MdeModulePkg/Universal/PCD/Dxe/Service.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index 3965846..5ade8d9 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -817,6 +817,11 @@ UpdatePcdDatabase ( //
Index = (mPcdDatabase.DxeDb->Length + 7) & (~7);
SkuDelta = NULL;
+
+ if (Index == mDxePcdDbSize) {
+ return EFI_SUCCESS;
+ }
+
while (Index < mDxePcdDbSize) {
SkuDelta = (PCD_DATABASE_SKU_DELTA *)((UINT8 *)mDxePcdDbBinary + Index);
if ((SkuDelta->SkuId == SkuId) && (SkuDelta->SkuIdCompared == 0)) {
|