From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=chasel.chiu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 652D92117B567 for ; Thu, 25 Oct 2018 20:18:49 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Oct 2018 20:18:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,426,1534834800"; d="scan'208";a="81682701" Received: from cchiu4-mobl1.gar.corp.intel.com ([10.5.240.24]) by fmsmga008.fm.intel.com with ESMTP; 25 Oct 2018 20:18:47 -0700 From: "Chasel, Chiu" To: edk2-devel@lists.01.org Cc: Jiewen Yao , Desimone Nathaniel L , Chasel Chiu Date: Fri, 26 Oct 2018 11:18:34 +0800 Message-Id: <20181026031834.2736-1-chasel.chiu@intel.com> X-Mailer: git-send-email 2.13.3.windows.1 Subject: [PATCH] IntelFsp2Pkg: Fix GCC49/XCODE build failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2018 03:18:49 -0000 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 Cc: Desimone Nathaniel L Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chasel Chiu --- IntelFsp2Pkg/FspSecCore/SecMain.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/IntelFsp2Pkg/FspSecCore/SecMain.c b/IntelFsp2Pkg/FspSecCore/SecMain.c index ddbfc4fcdf..f319c68cc5 100644 --- a/IntelFsp2Pkg/FspSecCore/SecMain.c +++ b/IntelFsp2Pkg/FspSecCore/SecMain.c @@ -107,13 +107,12 @@ SecStartup ( } IdtSize = sizeof (IdtTableInStack.IdtTable); } else { - if (IdtDescriptor.Limit + 1 > sizeof (IdtTableInStack.IdtTable)) { + IdtSize = IdtDescriptor.Limit + 1; + if (IdtSize > sizeof (IdtTableInStack.IdtTable)) { // // ERROR: IDT table size from boot loader is larger than FSP can support, DeadLoop here! // CpuDeadLoop(); - } else { - IdtSize = IdtDescriptor.Limit + 1; } CopyMem ((VOID *) (UINTN) &IdtTableInStack.IdtTable, (VOID *) IdtDescriptor.Base, IdtSize); } -- 2.13.3.windows.1