From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=15.233.44.25; helo=g2t2352.austin.hpe.com; envelope-from=thomas.palmer@hpe.com; receiver=edk2-devel@lists.01.org Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) (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 AAA9D203369D9 for ; Mon, 9 Jul 2018 13:17:54 -0700 (PDT) Received: from G9W8456.americas.hpqcorp.net (g9w8456.houston.hp.com [16.216.161.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2352.austin.hpe.com (Postfix) with ESMTPS id 788EDD9 for ; Mon, 9 Jul 2018 20:17:53 +0000 (UTC) Received: from G4W9119.americas.hpqcorp.net (2002:10d2:14d6::10d2:14d6) by G9W8456.americas.hpqcorp.net (2002:10d8:a15f::10d8:a15f) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 9 Jul 2018 20:17:53 +0000 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (15.241.52.11) by G4W9119.americas.hpqcorp.net (16.210.20.214) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 9 Jul 2018 20:17:53 +0000 Received: from CS1PR8401MB0773.NAMPRD84.PROD.OUTLOOK.COM (10.169.15.145) by CS1PR8401MB0997.NAMPRD84.PROD.OUTLOOK.COM (10.169.24.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.20; Mon, 9 Jul 2018 20:17:50 +0000 Received: from CS1PR8401MB0773.NAMPRD84.PROD.OUTLOOK.COM ([fe80::b19b:f901:2004:9e94]) by CS1PR8401MB0773.NAMPRD84.PROD.OUTLOOK.COM ([fe80::b19b:f901:2004:9e94%8]) with mapi id 15.20.0930.022; Mon, 9 Jul 2018 20:17:49 +0000 From: "Palmer, Thomas" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Dong, Eric" , "Ni, Ruiyu" , "Li, Gary (HPS SW)" , "Shifflett, Joseph" Thread-Topic: [PATCH 1/1] MdeModulePkg/PciBusDxe: Fix small memory leak in FreePciDevice Thread-Index: AQHUEuMuuy58Xw+G/E6v1b0fLbS6vaSB0bUAgAWMPZA= Date: Mon, 9 Jul 2018 20:17:49 +0000 Message-ID: References: <1530631973-5775-1-git-send-email-thomas.palmer@hpe.com> <0C09AFA07DD0434D9E2A0C6AEB0483103BB7B8B2@shsmsx102.ccr.corp.intel.com> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB0483103BB7B8B2@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=thomas.palmer@hpe.com; x-originating-ip: [15.211.195.6] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CS1PR8401MB0997; 7:Iy5+dnFx1MYKa2WkyaAR1uWLlkbSLrhhNP8/sOj7wxszwNh6vG9OWysbOhBwED6lC7R/Cyqe4V3MeMYybNIf7OIXlZ/qzxRVGxuK/WIwgm+vsSTVGbtGnfrQ9fk82+Z9mHqhrX6VsVhciUouveCqdVGZvReMqiBTAo8YaeeFU98PGlTDvVnhfem5XHli6gMvNpHWKHWfcIWxS4EppMl2kLQM8TIy8nJpjN+q04ZkKcF73mrm7A+QijFTV94VK23A x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10019020)(366004)(39860400002)(396003)(136003)(346002)(376002)(13464003)(51914003)(189003)(199004)(2906002)(6436002)(111196013)(55016002)(5250100002)(6116002)(8676002)(105586002)(256004)(14444005)(478600001)(99286004)(186003)(2501003)(25786009)(81166006)(81156014)(476003)(26005)(68736007)(8936002)(486006)(102836004)(86362001)(229853002)(6506007)(11346002)(3846002)(53546011)(446003)(110136005)(305945005)(2900100001)(316002)(7696005)(14454004)(9686003)(4326008)(97736004)(106356001)(66066001)(6246003)(7736002)(74316002)(53936002)(5660300001)(54906003)(33656002)(76176011); DIR:OUT; SFP:1102; SCL:1; SRVR:CS1PR8401MB0997; H:CS1PR8401MB0773.NAMPRD84.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-office365-filtering-correlation-id: b92c4e46-5244-45ff-23c1-08d5e5d90af9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:(222181515654134); BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(48565401081)(2017052603328)(7153060)(7193020); SRVR:CS1PR8401MB0997; x-ms-traffictypediagnostic: CS1PR8401MB0997: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(162533806227266)(222181515654134)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:CS1PR8401MB0997; BCL:0; PCL:0; RULEID:; SRVR:CS1PR8401MB0997; x-forefront-prvs: 07283408BE received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3vJyzqbv8gHfqAuh1zlJwlQ3fBAeIjyKmv/1yznebaZsKbUyKjQQ/mXEZGylC8SiyVlSMKG7hIC59O3BWEtZU1Bm54uIPB2hjJGH4K0M6G9JH68AoYDdANkAhPgJE/8NKryEM2lDGAatyVqIK+M7Fw3r3Q5mFpxXMdgeN11hfjiuCEJB8yIaCp1lmgF3LU22UkinUWPF9/GVkfCB0uNIUjqgc5265T7VokMuo0vSOcARm7jmLmC5oxWizGaTETkQc4XFQujJ9uSZKSr7NbspjFj1OJGKDxSs34M2Bw7Y7oJJmY5gIHUjaXI8Wjtp17Hy78tWC5pvco+2ajCG3V7GITwv7CZANJWtpw8kpH+4oms= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b92c4e46-5244-45ff-23c1-08d5e5d90af9 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jul 2018 20:17:49.5994 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0997 X-OriginatorOrg: 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: Mon, 09 Jul 2018 20:17:54 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I can wait, thanks for the heads up -----Original Message----- From: Zeng, Star [mailto:star.zeng@intel.com]=20 Sent: Friday, July 6, 2018 2:34 AM To: Palmer, Thomas ; edk2-devel@lists.01.org Cc: Dong, Eric ; Ni, Ruiyu ; Li, G= ary (HPS SW) ; Shifflett, Joseph = ; Zeng, Star Subject: RE: [PATCH 1/1] MdeModulePkg/PciBusDxe: Fix small memory leak in F= reePciDevice Hi Thomas, Basically, I agree with this patch as PciIoDevice->BusNumberRanges equals C= onfiguration from PciResAlloc->StartBusEnumeration, and according to PI spe= c "Because the size of ACPI resource descriptors is not fixed, StartBusEnum= eration() is responsible for allocating memory for the buffer Configuration= ". But I hope Ruiyu can double confirm it. Since Ruiyu is taking leave for some days, could you wait? Thanks, Star -----Original Message----- From: Thomas Palmer [mailto:thomas.palmer@hpe.com]=20 Sent: Tuesday, July 3, 2018 11:33 PM To: edk2-devel@lists.01.org Cc: Dong, Eric ; Zeng, Star ; Ni,= Ruiyu ; garyli@hpe.com; joseph.shifflett@hpe.com; Thom= as Palmer Subject: [PATCH 1/1] MdeModulePkg/PciBusDxe: Fix small memory leak in FreeP= ciDevice 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/MdeModuleP= kg/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. =20 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 availab= le under the terms and conditions of the BSD License which accompanies thi= s distribution. The full text of the license may be found at @@ -105,6 +10= 6,10 @@ FreePciDevice ( FreePool (PciIoDevice->DevicePath); } =20 + if (PciIoDevice->BusNumberRanges !=3D NULL) { + FreePool (PciIoDevice->BusNumberRanges); } + FreePool (PciIoDevice); } =20 -- 2.7.4