From nobody Sat Nov 2 08:40:17 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 1492410536687425.29286771397676; Sun, 16 Apr 2017 23:28:56 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3A88320D7A3B2; Sun, 16 Apr 2017 23:28:54 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 DD77E20D7A3AE for ; Sun, 16 Apr 2017 23:28:52 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 16 Apr 2017 23:28:52 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga004.fm.intel.com with ESMTP; 16 Apr 2017 23:28:51 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,213,1488873600"; d="scan'208";a="249980241" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 17 Apr 2017 14:28:49 +0800 Message-Id: <20170417062849.90528-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 Subject: [edk2] [PATCH] ShellPkg/ConsistMapping: Remove unneeded memory reallocation 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: Jaben Carsey , Michael Turner 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" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Michael Turner Cc: Jaben Carsey Reviewed-by: Jaben Carsey --- ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c b/ShellP= kg/Library/UefiShellCommandLib/ConsistMapping.c index 09f2c56..3b13e62 100755 --- a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c +++ b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c @@ -1,7 +1,7 @@ /** @file Main file for support of shell consist mapping. =20 - Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may be= found at @@ -1610,7 +1610,6 @@ ShellCommandConsistMappingGenMappingName ( DEVICE_CONSIST_MAPPING_INFO MappingInfo; EFI_DEVICE_PATH_PROTOCOL *HIDevicePath; UINTN Index; - CHAR16 *NewStr; =20 ASSERT(DevicePath !=3D NULL); ASSERT(Table !=3D NULL); @@ -1667,13 +1666,7 @@ ShellCommandConsistMappingGenMappingName ( return NULL; } =20 - NewStr =3D ReallocatePool (Str.Len * sizeof (CHAR16), (Str.Len + 1) * si= zeof (CHAR16), Str.Str); - if (NewStr =3D=3D NULL) { - SHELL_FREE_NON_NULL (Str.Str); - return (NULL); - } - NewStr[Str.Len] =3D CHAR_NULL; - return NewStr; + return Str.Str; } =20 /** --=20 2.9.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel