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>
This commit is contained in:
Gua Guo 2022-05-06 05:29:51 +08:00 committed by mergify[bot]
parent 29ae55a0b8
commit a658ed30e5

View File

@ -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)) {