]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Adds ASSERT check in DxePcd driver when error status of read DynamicHii PCD is not...
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 27 Feb 2013 03:01:40 +0000 (03:01 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 27 Feb 2013 03:01:40 +0000 (03:01 +0000)
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14147 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/PCD/Dxe/Service.c

index 53780dca9fac2db9d2713fff74a3495e26071064..6eaadd6cceef24b8e381c6a7a7a90e7d8e18584d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
     Help functions used by PCD DXE driver.\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -150,6 +150,11 @@ GetWorker (
             //\r
             GetPtrTypeSize (TmpTokenNumber, &GetSize);\r
           }\r
+          //\r
+          // If the operation is successful, we copy the data\r
+          // to the default value buffer in the PCD Database.\r
+          // So that we can free the Data allocated in GetHiiVariable.\r
+          //\r
           CopyMem (VaraiableDefaultBuffer, Data + VariableHead->Offset, GetSize);\r
           FreePool (Data);\r
         }\r
@@ -166,19 +171,14 @@ GetWorker (
             //\r
             GetPtrTypeSize (TmpTokenNumber, &GetSize);\r
           }\r
+          //\r
+          // If the operation is successful, we copy the data\r
+          // to the default value buffer in the PCD Database.\r
+          // So that we can free the Data allocated in GetHiiVariable.\r
+          //\r
           CopyMem (VaraiableDefaultBuffer, Data + VariableHead->Offset, GetSize);\r
           FreePool (Data);\r
         }\r
-        //\r
-        // If the operation is successful, we copy the data\r
-        // to the default value buffer in the PCD Database.\r
-        // So that we can free the Data allocated in GetHiiVariable.\r
-        //\r
-        //\r
-        // If the operation is not successful, \r
-        // Return 1) either the default value specified by Platform Integrator \r
-        //        2) Or the value Set by a PCD set operation.\r
-        //\r
         RetPtr = (VOID *) VaraiableDefaultBuffer;\r
       }\r
       break;\r
@@ -535,6 +535,12 @@ GetHiiVariable (
     ASSERT (Status == EFI_SUCCESS);\r
     *VariableData = Buffer;\r
     *VariableSize = Size;\r
+  } else {\r
+    //\r
+    // Use Default Data only when variable is not found. \r
+    // For other error status, correct data can't be got, and trig ASSERT().\r
+    //\r
+    ASSERT (Status == EFI_NOT_FOUND);\r
   }\r
 \r
   return Status;\r