public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/PCI: fix boot-time memory leak
@ 2011-09-23 16:59 Bjorn Helgaas
  2011-10-17 16:30 ` Bjorn Helgaas
  0 siblings, 1 reply; 8+ messages in thread
From: Bjorn Helgaas @ 2011-09-23 16:59 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: Bernd Schubert, linux-pci, linux-acpi, Simon Kirby,
	Catalin Marinas

If we're not using _CRS, the host bridge's bus name and resource structures
were allocated but never freed.  This patch fixes that.

Patch by Catalin Marinas <catalin.marinas@arm.com>

Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Reported-by: Simon Kirby <sim@hostway.ca>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/x86/pci/acpi.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index c953302..6fdc90f 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -228,9 +228,6 @@ static void add_resources(struct pci_root_info *info)
 	int i;
 	struct resource *res, *root, *conflict;
 
-	if (!pci_use_crs)
-		return;
-
 	coalesce_windows(info, IORESOURCE_MEM);
 	coalesce_windows(info, IORESOURCE_IO);
 
@@ -285,8 +282,11 @@ get_current_resources(struct acpi_device *device, int busnum,
 	acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
 				&info);
 
-	add_resources(&info);
-	return;
+	if (pci_use_crs) {
+		add_resources(&info);
+		return;
+	}
+	kfree(info.name);
 
 name_alloc_fail:
 	kfree(info.res);


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] x86/PCI: fix boot-time memory leak
@ 2011-10-17 19:40 Bjorn Helgaas
  2011-10-17 19:46 ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Bjorn Helgaas @ 2011-10-17 19:40 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin
  Cc: Bernd Schubert, linux-pci, linux-acpi, Simon Kirby,
	Catalin Marinas

From: Catalin Marinas <catalin.marinas@arm.com>

If we're not using _CRS, the host bridge's bus name and resource structures
were allocated but never freed.  This patch fixes that.

Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Reported-by: Simon Kirby <sim@hostway.ca>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 arch/x86/pci/acpi.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 404f21a..bac9b94 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -239,9 +239,6 @@ static void add_resources(struct pci_root_info *info)
 	int i;
 	struct resource *res, *root, *conflict;
 
-	if (!pci_use_crs)
-		return;
-
 	coalesce_windows(info, IORESOURCE_MEM);
 	coalesce_windows(info, IORESOURCE_IO);
 
@@ -296,8 +293,11 @@ get_current_resources(struct acpi_device *device, int busnum,
 	acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource,
 				&info);
 
-	add_resources(&info);
-	return;
+	if (pci_use_crs) {
+		add_resources(&info);
+		return;
+	}
+	kfree(info.name);
 
 name_alloc_fail:
 	kfree(info.res);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-10-17 21:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-23 16:59 [PATCH] x86/PCI: fix boot-time memory leak Bjorn Helgaas
2011-10-17 16:30 ` Bjorn Helgaas
2011-10-17 19:17   ` Yinghai Lu
2011-10-17 21:04     ` Catalin Marinas
  -- strict thread matches above, loose matches on Subject: below --
2011-10-17 19:40 Bjorn Helgaas
2011-10-17 19:46 ` Greg KH
2011-10-17 19:59   ` Bjorn Helgaas
2011-10-17 20:21     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox