]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MtrrLib:Initialize local variables before use them
authorJeff Fan <jeff.fan@intel.com>
Thu, 10 Dec 2015 07:10:13 +0000 (07:10 +0000)
committervanjeff <vanjeff@Edk2>
Thu, 10 Dec 2015 07:10:13 +0000 (07:10 +0000)
Cc: Shumin Qiu <shumin.qiu@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19183 6f19259b-4bc3-4df7-8a09-765794883524

UefiCpuPkg/Library/MtrrLib/MtrrLib.c

index f5b3460f1316e642ecc4b55f306a57a7277bd8de..199e165d466a262204d24540e11d8cacd2f3cab7 100644 (file)
@@ -1489,7 +1489,9 @@ MtrrSetMemoryAttributeWorker (
   UINT64                    NewValue;\r
   MTRR_VARIABLE_SETTINGS    *VariableSettings;\r
 \r
-  MtrrContextValid = FALSE;\r
+  MtrrContextValid  = FALSE;\r
+  VariableMtrrCount = 0;\r
+  ZeroMem (&WorkingFixedSettings, sizeof (WorkingFixedSettings));\r
   for (Index = 0; Index < MTRR_NUMBER_OF_FIXED_MTRR; Index++) {\r
     FixedSettingsValid[Index]    = FALSE;\r
     FixedSettingsModified[Index] = FALSE;\r