]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/PCD/Pei/Service.c
According to PI 1.2 spec Vol 3 chapter 8 PCD, if the PCD service determined that...
[mirror_edk2.git] / MdeModulePkg / Universal / PCD / Pei / Service.c
index a791ef725a35d5b1cc05036ac90da9043b61d997..135d3dd3975141b5ac9130ee77d048daf6d6d1d8 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 - 2009, Intel Corporation\r
+Copyright (c) 2006 - 2010, 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
@@ -344,6 +344,7 @@ SetValueWorker (
 \r
   @retval EFI_INVALID_PARAMETER  If this PCD type is VPD, VPD PCD can not be set.\r
   @retval EFI_INVALID_PARAMETER  If Size can not be set to size table.\r
+  @retval EFI_INVALID_PARAMETER  If Size of non-Ptr type PCD does not match the size information in PCD database.\r
   @retval EFI_NOT_FOUND          If value type of PCD entry is intergrate, but not in\r
                                  range of UINT8, UINT16, UINT32, UINT64\r
   @retval EFI_NOT_FOUND          Can not find the PCD type according to token number.                                \r
@@ -383,8 +384,8 @@ SetWorker (
 \r
   LocalTokenNumber = PeiPcdDb->Init.LocalTokenNumberTable[TokenNumber];\r
 \r
-  if (!PtrType) {\r
-    ASSERT (PeiPcdGetSize(TokenNumber + 1) == *Size);\r
+  if ((!PtrType) && (PeiPcdGetSize(TokenNumber + 1) != *Size)) {\r
+    return EFI_INVALID_PARAMETER;\r
   }\r
 \r
   //\r