]> git.proxmox.com Git - mirror_edk2.git/commitdiff
According to PI specification, if token number can not be found for dynamic-ex type...
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 3 Dec 2009 05:59:57 +0000 (05:59 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 3 Dec 2009 05:59:57 +0000 (05:59 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9511 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/PCD/Pei/Service.c

index 200c0d463957e9cc21f1ec61af12f3b349924a3f..a791ef725a35d5b1cc05036ac90da9043b61d997 100644 (file)
@@ -2,7 +2,7 @@
   The driver internal functions are implmented here.\r
   They build Pei PCD database, and provide access service to PCD database.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation\r
+Copyright (c) 2006 - 2009, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -57,7 +57,10 @@ PeiRegisterCallBackWorker (
     ASSERT (TokenNumber + 1 < PEI_NEX_TOKEN_NUMBER + 1);\r
   } else {\r
     TokenNumber = GetExPcdTokenNumber (Guid, ExTokenNumber);\r
-\r
+    if (TokenNumber == PCD_INVALID_TOKEN_NUMBER) {\r
+      return EFI_NOT_FOUND;\r
+    }\r
+    \r
     //\r
     // TokenNumber Zero is reserved as PCD_INVALID_TOKEN_NUMBER.\r
     // We have to decrement TokenNumber by 1 to make it usable\r
@@ -519,7 +522,10 @@ ExSetWorker (
   }\r
 \r
   TokenNumber = GetExPcdTokenNumber (Guid, ExTokenNumber);\r
-\r
+  if (TokenNumber == PCD_INVALID_TOKEN_NUMBER) {\r
+    return EFI_NOT_FOUND;\r
+  }\r
+  \r
   InvokeCallbackOnSet (ExTokenNumber, Guid, TokenNumber, Data, *Size);\r
 \r
   return SetWorker (TokenNumber, Data, Size, PtrType);\r
@@ -702,9 +708,7 @@ GetExPcdTokenNumber (
     }\r
   }\r
   \r
-  ASSERT (FALSE);\r
-  \r
-  return 0;\r
+  return PCD_INVALID_TOKEN_NUMBER;\r
 }\r
 \r
 /**\r