Current code allocate buffer for the pointer which later get value from PCD database. but current code error use "=" for this case. Use AllocateCopyPool instead to fix it.
V2 enhanced to directly use AllocateCopyPool to get the PCD value. Cc: Ruiyu Ni <[email protected]> Cc: Shao Ming <[email protected]> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong <[email protected]> --- UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c index 474aea3..b3b2d84 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c @@ -64,9 +64,8 @@ GetSupportPcds ( UINT8 *SupportBitMask; BitMaskSize = PcdGetSize (PcdCpuFeaturesSupport); - SupportBitMask = AllocateZeroPool (BitMaskSize); + SupportBitMask = AllocateCopyPool (BitMaskSize, (UINT8 *) PcdGetPtr (PcdCpuFeaturesSupport)); ASSERT (SupportBitMask != NULL); - SupportBitMask = (UINT8 *) PcdGetPtr (PcdCpuFeaturesSupport); return SupportBitMask; } @@ -85,9 +84,8 @@ GetConfigurationPcds ( UINT8 *SupportBitMask; BitMaskSize = PcdGetSize (PcdCpuFeaturesUserConfiguration); - SupportBitMask = AllocateZeroPool (BitMaskSize); + SupportBitMask = AllocateCopyPool (BitMaskSize, (UINT8 *) PcdGetPtr (PcdCpuFeaturesUserConfiguration)); ASSERT (SupportBitMask != NULL); - SupportBitMask = (UINT8 *) PcdGetPtr (PcdCpuFeaturesUserConfiguration); return SupportBitMask; } -- 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

