diff options
author | Star Zeng <star.zeng@intel.com> | 2015-10-16 01:46:19 +0000 |
---|---|---|
committer | lzeng14 <lzeng14@Edk2> | 2015-10-16 01:46:19 +0000 |
commit | fe3ca12d06a534e5f10587a52730f5fd43dab831 (patch) | |
tree | 5eb128be243796196ff0872bf428d690172d3c3d /SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c | |
parent | e90c57aa97558f4b70984a3a4a5f734e4546e1f4 (diff) | |
download | edk2-platforms-fe3ca12d06a534e5f10587a52730f5fd43dab831.tar.xz |
SecurityPkg: Use PcdSet##S to instead of PcdSet##
PcdSet## has no error status returned, then the caller has no idea about whether the set operation is successful or not.
PcdSet##S were added to return error status and PcdSet## APIs were put in ifndef DISABLE_NEW_DEPRECATED_INTERFACES condition.
To adopt PcdSet##S and further code development with DISABLE_NEW_DEPRECATED_INTERFACES defined, we need to Replace PcdSet## usage with PcdSet##S.
Normally, DynamicDefault PCD set is expected to be success, but DynamicHii PCD set failure is a legal case.
PcdTpmInitializationPolicy/PcdTcg2HashAlgorithmBitmap/PcdTpm2HashMask/PcdTpmInstanceGuid all have set operation in PEI phase,
PEI phase does not allow DynamicHii PCD set, so DynamicDefault is expected for them and use PcdSet##S to instead of PcdSet## and assert when set failure.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18614 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c')
-rw-r--r-- | SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c index 34767c0f49..004c7efe70 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigPeim.c @@ -132,7 +132,8 @@ Tcg2ConfigPeimEntryPoint ( for (Index = 0; Index < sizeof(mTpmInstanceId)/sizeof(mTpmInstanceId[0]); Index++) {
if (TpmDevice == mTpmInstanceId[Index].TpmDevice) {
Size = sizeof(mTpmInstanceId[Index].TpmInstanceGuid);
- PcdSetPtr (PcdTpmInstanceGuid, &Size, &mTpmInstanceId[Index].TpmInstanceGuid);
+ Status = PcdSetPtrS (PcdTpmInstanceGuid, &Size, &mTpmInstanceId[Index].TpmInstanceGuid);
+ ASSERT_EFI_ERROR (Status);
DEBUG ((EFI_D_INFO, "TpmDevice PCD: %g\n", &mTpmInstanceId[Index].TpmInstanceGuid));
break;
}
|