]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFsp2Pkg: Fix GCC49/XCODE build failure
authorChasel, Chiu <chasel.chiu@intel.com>
Fri, 26 Oct 2018 02:41:49 +0000 (10:41 +0800)
committerChasel, Chiu <chasel.chiu@intel.com>
Fri, 26 Oct 2018 03:34:21 +0000 (11:34 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1276

Fixed potentially uninitialized variable build failure
caused by commit: b1cc6f672f3b924cdb190e5b92db3b47f46a8911

Test: Verified on internal platform and boots successfully.

Cc: Jiewen Yao <Jiewen.yao@intel.com>
Cc: Desimone Nathaniel L <nathaniel.l.desimone@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
IntelFsp2Pkg/FspSecCore/SecMain.c

index ddbfc4fcdf0b5a14abf47a3546f9977785ec0410..f319c68cc56067a3d265a30ba9edd1249367b2f4 100644 (file)
@@ -107,13 +107,12 @@ SecStartup (
     }\r
     IdtSize = sizeof (IdtTableInStack.IdtTable);\r
   } else {\r
-    if (IdtDescriptor.Limit + 1 > sizeof (IdtTableInStack.IdtTable)) {\r
+    IdtSize = IdtDescriptor.Limit + 1;\r
+    if (IdtSize > sizeof (IdtTableInStack.IdtTable)) {\r
       //\r
       // ERROR: IDT table size from boot loader is larger than FSP can support, DeadLoop here!\r
       //\r
       CpuDeadLoop();\r
-    } else {\r
-      IdtSize = IdtDescriptor.Limit + 1;\r
     }\r
     CopyMem ((VOID *) (UINTN) &IdtTableInStack.IdtTable, (VOID *) IdtDescriptor.Base, IdtSize);\r
   }\r