From nobody Sat Nov 2 10:38:01 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1491804941569457.70678782692437; Sun, 9 Apr 2017 23:15:41 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 242CC21A0480E; Sun, 9 Apr 2017 23:15:39 -0700 (PDT) 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) 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 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 X-Original-To: edk2-devel@lists.01.org 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==; X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,181,1488873600"; d="scan'208";a="86797820" From: Hao Wu To: edk2-devel@lists.01.org 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: [edk2] [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: , Cc: Hao Wu , Jiewen Yao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu Reviewed-by: jiewen.yao@intel.com --- MdeModulePkg/Core/PiSmmCore/Pool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/PiSmmCore/Pool.c b/MdeModulePkg/Core/PiSmmCo= re/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. =20 - 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 availa= ble=20 under the terms and conditions of the BSD License which accompanies this=20 distribution. The full text of the license may be found at =20 @@ -136,6 +136,7 @@ InternalAllocPoolByIndex ( EFI_PHYSICAL_ADDRESS Address; SMM_POOL_TYPE SmmPoolType; =20 + Address =3D 0; SmmPoolType =3D UefiMemoryTypeToSmmPoolType(PoolType); =20 ASSERT (PoolIndex <=3D MAX_POOL_INDEX); @@ -227,6 +228,8 @@ SmmInternalAllocatePool ( EFI_PHYSICAL_ADDRESS Address; UINTN PoolIndex; =20 + Address =3D 0; + if (PoolType !=3D EfiRuntimeServicesCode && PoolType !=3D EfiRuntimeServicesData) { return EFI_INVALID_PARAMETER; --=20 2.12.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel