]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MpInitLib: MicrocodeData used but maybe uninitialized
authorJeff Fan <jeff.fan@intel.com>
Fri, 19 Aug 2016 02:32:30 +0000 (10:32 +0800)
committerJeff Fan <jeff.fan@intel.com>
Fri, 19 Aug 2016 07:11:01 +0000 (15:11 +0800)
Cc: Feng Tian <feng.tian@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
UefiCpuPkg/Library/MpInitLib/Microcode.c

index 0fd8e8c51bc8d7553198a7d5dafb869ac7cd65d9..5bb0145c87f04fe103a85be761d135e37dbc036d 100644 (file)
@@ -92,6 +92,7 @@ MicrocodeDetect (
   PlatformId = (UINT8) PlatformIdMsr.Bits.PlatformId;\r
 \r
   LatestRevision = 0;\r
+  MicrocodeData  = NULL;\r
   MicrocodeEnd = (UINTN) (MicrocodePatchAddress + MicrocodePatchRegionSize);\r
   MicrocodeEntryPoint = (CPU_MICROCODE_HEADER *) (UINTN) MicrocodePatchAddress;\r
   do {\r
@@ -198,6 +199,7 @@ MicrocodeDetect (
     // Revision. A processor with no loaded update is considered to have a\r
     // revision equal to zero.\r
     //\r
+    ASSERT (MicrocodeData != NULL);\r
     AsmWriteMsr64 (\r
         MSR_IA32_BIOS_UPDT_TRIG,\r
         (UINT64) (UINTN) MicrocodeData\r