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.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 186F22097F544 for ; Tue, 17 Jul 2018 21:33:17 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jul 2018 21:33:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,368,1526367600"; d="scan'208";a="72271119" Received: from ray-dev.ccr.corp.intel.com (HELO [10.239.9.4]) ([10.239.9.4]) by fmsmga004.fm.intel.com with ESMTP; 17 Jul 2018 21:33:16 -0700 To: Thomas Palmer , edk2-devel@lists.01.org Cc: eric.dong@intel.com, star.zeng@intel.com, garyli@hpe.com, joseph.shifflett@hpe.com References: <1530631973-5775-1-git-send-email-thomas.palmer@hpe.com> From: "Ni, Ruiyu" Message-ID: <03be8cbe-318e-5629-c72b-82e24a3fdc23@Intel.com> Date: Wed, 18 Jul 2018 12:33:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.0 MIME-Version: 1.0 In-Reply-To: <1530631973-5775-1-git-send-email-thomas.palmer@hpe.com> Subject: Re: [PATCH 1/1] MdeModulePkg/PciBusDxe: Fix small memory leak in FreePciDevice X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jul 2018 04:33:18 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 7/3/2018 11:32 PM, Thomas Palmer wrote: > When cleaning the PciIoDevice, also free the BusNumberRange > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Thomas Palmer > --- > MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c > index ad7a2337f578..48cf57a24f8f 100644 > --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c > +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c > @@ -2,6 +2,7 @@ > Supporting functions implementaion for PCI devices management. > > Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +(C) Copyright 2018 Hewlett Packard Enterprise Development LP
> 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 > @@ -105,6 +106,10 @@ FreePciDevice ( > FreePool (PciIoDevice->DevicePath); > } > > + if (PciIoDevice->BusNumberRanges != NULL) { > + FreePool (PciIoDevice->BusNumberRanges); > + } > + > FreePool (PciIoDevice); > } > > Reviewed-by: Ruiyu Ni -- Thanks, Ray