mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix a memory leak reported by kmemleak.
@ 2011-06-21 11:08 Bernd Schubert
  2011-06-21 12:46 ` Catalin Marinas
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Schubert @ 2011-06-21 11:08 UTC (permalink / raw)
  To: x86; +Cc: catalin.marinas, linux-kernel

Memory allocated by get_current_resources() will be never free'ed
if 'pci_use_crs' is not set.

Signed-off-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
---
 arch/x86/pci/acpi.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 0972315..3ad040a 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -228,8 +228,11 @@ static void add_resources(struct pci_root_info *info)
 	int i;
 	struct resource *res, *root, *conflict;
 
-	if (!pci_use_crs)
+	if (!pci_use_crs) {
+		kfree(info->res);
+		kfree(info->name);
 		return;
+	}
 
 	coalesce_windows(info, IORESOURCE_MEM);
 	coalesce_windows(info, IORESOURCE_IO);


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

end of thread, other threads:[~2011-06-21 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-21 11:08 [PATCH] Fix a memory leak reported by kmemleak Bernd Schubert
2011-06-21 12:46 ` Catalin Marinas

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

all inboxes | Powered by JetHome®