public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zeng, Star" <star.zeng@intel.com>
To: Thomas Palmer <thomas.palmer@hpe.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Dong, Eric" <eric.dong@intel.com>,
	"Ni, Ruiyu" <ruiyu.ni@intel.com>,
	"garyli@hpe.com" <garyli@hpe.com>,
	"joseph.shifflett@hpe.com" <joseph.shifflett@hpe.com>,
	"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH 1/1] MdeModulePkg/PciBusDxe: Fix small memory leak in FreePciDevice
Date: Fri, 6 Jul 2018 07:34:16 +0000	[thread overview]
Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103BB7B8B2@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1530631973-5775-1-git-send-email-thomas.palmer@hpe.com>

Hi Thomas,

Basically, I agree with this patch as PciIoDevice->BusNumberRanges equals Configuration from PciResAlloc->StartBusEnumeration, and according to PI spec "Because the size of ACPI resource descriptors is not fixed, StartBusEnumeration() 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] 
Sent: Tuesday, July 3, 2018 11:33 PM
To: edk2-devel@lists.01.org
Cc: Dong, Eric <eric.dong@intel.com>; Zeng, Star <star.zeng@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; garyli@hpe.com; joseph.shifflett@hpe.com; Thomas Palmer <thomas.palmer@hpe.com>
Subject: [PATCH 1/1] MdeModulePkg/PciBusDxe: Fix small memory leak in FreePciDevice

When cleaning the PciIoDevice, also free the BusNumberRange

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Thomas Palmer <thomas.palmer@hpe.com>
---
 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.<BR>
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP<BR>
 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);
 }
 
--
2.7.4



  reply	other threads:[~2018-07-06  7:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03 15:32 [PATCH 1/1] MdeModulePkg/PciBusDxe: Fix small memory leak in FreePciDevice Thomas Palmer
2018-07-06  7:34 ` Zeng, Star [this message]
2018-07-09 20:17   ` Palmer, Thomas
2018-07-18  4:33 ` Ni, Ruiyu
2018-07-27  1:01   ` Zeng, Star

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0C09AFA07DD0434D9E2A0C6AEB0483103BB7B8B2@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox