[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1222327705-22048-1-git-send-email-yhlu.kernel@gmail.com>
Date: Thu, 25 Sep 2008 00:28:25 -0700
From: Yinghai Lu <yhlu.kernel@...il.com>
To: Suresh Siddha <suresh.b.siddha@...el.com>,
Jesse Barnes <jbarnes@...tuousgeek.org>,
Ingo Molnar <mingo@...e.hu>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
Yinghai Lu <yhlu.kernel@...il.com>
Subject: [PATCH] x86/pci: fix dmar_tbl early_ioremap leak v2
use early_acpi_os_unmap_memory
v2: move unmap_memory early...
Signed-off-by: Yinghai Lu <yhlu.kernel@...il.com>
---
drivers/pci/dmar.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: linux-2.6/drivers/pci/dmar.c
===================================================================
--- linux-2.6.orig/drivers/pci/dmar.c
+++ linux-2.6/drivers/pci/dmar.c
@@ -42,6 +42,7 @@
LIST_HEAD(dmar_drhd_units);
static struct acpi_table_header * __initdata dmar_tbl;
+static acpi_size __initdata dmar_tbl_size;
static void __init dmar_register_drhd_unit(struct dmar_drhd_unit *drhd)
{
@@ -297,8 +298,9 @@ static int __init dmar_table_detect(void
acpi_status status = AE_OK;
/* if we could find DMAR table, then there are DMAR devices */
- status = acpi_get_table(ACPI_SIG_DMAR, 0,
- (struct acpi_table_header **)&dmar_tbl);
+ status = acpi_get_table_with_size(ACPI_SIG_DMAR, 0,
+ (struct acpi_table_header **)&dmar_tbl,
+ &dmar_tbl_size);
if (ACPI_SUCCESS(status) && !dmar_tbl) {
printk (KERN_WARNING PREFIX "Unable to map DMAR\n");
@@ -493,6 +495,9 @@ void __init detect_intel_iommu(void)
}
end:
#endif
+ if (dmar_tbl)
+ early_acpi_os_unmap_memory(dmar_tbl, dmar_tbl_size);
+
dmar_tbl = NULL;
}
--
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