[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110621110853.2537133.20464.stgit@localhost.localdomain>
Date: Tue, 21 Jun 2011 13:08:53 +0200
From: Bernd Schubert <bernd.schubert@...m.fraunhofer.de>
To: x86@...nel.org
Cc: catalin.marinas@....com, linux-kernel@...r.kernel.org
Subject: [PATCH] Fix a memory leak reported by kmemleak.
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@...m.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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists