From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 D465E21A0480E for ; Sun, 9 Apr 2017 23:15:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491804937; x=1523340937; h=from:to:cc:subject:date:message-id; bh=4xodWYS5BkJ3IBsz45XIDH6r9tkPw/T8ypmj/PXKAcY=; b=T3F4r3+YGt1pyDvdb/ikOohirprX7VFNE8lRu5joNOc7Xool3MPvJpx5 nXusE+DWjUWg7nREycAfIyqMqLeHIQ==; Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Apr 2017 23:15:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,181,1488873600"; d="scan'208";a="86797820" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga005.fm.intel.com with ESMTP; 09 Apr 2017 23:15:33 -0700 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Jiewen Yao Date: Mon, 10 Apr 2017 14:15:14 +0800 Message-Id: <20170410061514.14300-1-hao.a.wu@intel.com> X-Mailer: git-send-email 2.12.0.windows.1 Subject: [PATCH] MdeModulePkg/PiSmmCore: Fix potentially uninitialized local variable X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Apr 2017 06:15:38 -0000 Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu --- MdeModulePkg/Core/PiSmmCore/Pool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c b/MdeModulePkg/Core/PiSmmCore/Pool.c index f734b3f72d..43ce869d1e 100644 --- a/MdeModulePkg/Core/PiSmmCore/Pool.c +++ b/MdeModulePkg/Core/PiSmmCore/Pool.c @@ -1,7 +1,7 @@ /** @file SMM Memory pool management functions. - Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -136,6 +136,7 @@ InternalAllocPoolByIndex ( EFI_PHYSICAL_ADDRESS Address; SMM_POOL_TYPE SmmPoolType; + Address = 0; SmmPoolType = UefiMemoryTypeToSmmPoolType(PoolType); ASSERT (PoolIndex <= MAX_POOL_INDEX); @@ -227,6 +228,8 @@ SmmInternalAllocatePool ( EFI_PHYSICAL_ADDRESS Address; UINTN PoolIndex; + Address = 0; + if (PoolType != EfiRuntimeServicesCode && PoolType != EfiRuntimeServicesData) { return EFI_INVALID_PARAMETER; -- 2.12.0.windows.1