diff options
author | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-03-18 06:24:53 +0000 |
---|---|---|
committer | klu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-03-18 06:24:53 +0000 |
commit | 7d2ff3940693e875a0251cb1c4554e90fb551799 (patch) | |
tree | fee6b00fff642802b30c220a6c0cd55161410efa | |
parent | 5a58dfec4800356f6fd6ac51679a606a32182c33 (diff) | |
download | edk2-7d2ff3940693e875a0251cb1c4554e90fb551799.zip edk2-7d2ff3940693e875a0251cb1c4554e90fb551799.tar.gz edk2-7d2ff3940693e875a0251cb1c4554e90fb551799.tar.bz2 |
1, For Pcd_PPI, UnregistedCallBack should return EFI_INVALID_PARAMETER if Callback function can not be found.
2, PCD_PPI/PROTOCOL should return EFI_INVALID_PARAMETER if size is unmatched
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk@10276 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | edk2/MdeModulePkg/Universal/PCD/Dxe/Service.c | 10 | ||||
-rw-r--r-- | edk2/MdeModulePkg/Universal/PCD/Pei/Service.c | 13 |
2 files changed, 18 insertions, 5 deletions
diff --git a/edk2/MdeModulePkg/Universal/PCD/Dxe/Service.c b/edk2/MdeModulePkg/Universal/PCD/Dxe/Service.c index fc6f6b4..5d4fbbc 100644 --- a/edk2/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/edk2/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -740,8 +740,14 @@ SetWorker ( //
ASSERT (TokenNumber + 1 < PCD_TOTAL_TOKEN_NUMBER + 1);
- if ((!PtrType) && (*Size != DxePcdGetSize (TokenNumber + 1))) {
- return EFI_INVALID_PARAMETER;
+ if (PtrType) {
+ if (*Size > DxePcdGetSize (TokenNumber + 1)) {
+ return EFI_INVALID_PARAMETER;
+ }
+ } else {
+ if (*Size != DxePcdGetSize (TokenNumber + 1)) {
+ return EFI_INVALID_PARAMETER;
+ }
}
//
diff --git a/edk2/MdeModulePkg/Universal/PCD/Pei/Service.c b/edk2/MdeModulePkg/Universal/PCD/Pei/Service.c index 66e72f7..4f1511f 100644 --- a/edk2/MdeModulePkg/Universal/PCD/Pei/Service.c +++ b/edk2/MdeModulePkg/Universal/PCD/Pei/Service.c @@ -28,6 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. @retval EFI_NOT_FOUND If the PCD Entry is not found according to Token Number and GUID space.
@retval EFI_OUT_OF_RESOURCES If the callback function can't be registered because there is not free
slot left in the CallbackFnTable.
+ @retval EFI_INVALID_PARAMETER If the callback function want to be de-registered can not be found.
**/
EFI_STATUS
PeiRegisterCallBackWorker (
@@ -100,7 +101,7 @@ PeiRegisterCallBackWorker ( }
}
- return Register? EFI_OUT_OF_RESOURCES : EFI_NOT_FOUND;
+ return Register? EFI_OUT_OF_RESOURCES : EFI_INVALID_PARAMETER;
}
@@ -384,8 +385,14 @@ SetWorker ( LocalTokenNumber = PeiPcdDb->Init.LocalTokenNumberTable[TokenNumber];
- if ((!PtrType) && (PeiPcdGetSize(TokenNumber + 1) != *Size)) {
- return EFI_INVALID_PARAMETER;
+ if (PtrType) {
+ if (*Size > PeiPcdGetSize (TokenNumber + 1)) {
+ return EFI_INVALID_PARAMETER;
+ }
+ } else {
+ if (*Size != PeiPcdGetSize (TokenNumber + 1)) {
+ return EFI_INVALID_PARAMETER;
+ }
}
//
|