[PATCH] arch/tile: don't leak kernel memory when we unload modules

From: Chris Metcalf
Date: Fri Mar 30 2012 - 18:51:32 EST


We were failing to track the memory when we allocated it.

Signed-off-by: Chris Metcalf <cmetcalf@xxxxxxxxxx>
---
arch/tile/kernel/module.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/tile/kernel/module.c b/arch/tile/kernel/module.c
index bb2dc1e..001cbfa 100644
--- a/arch/tile/kernel/module.c
+++ b/arch/tile/kernel/module.c
@@ -67,6 +67,8 @@ void *module_alloc(unsigned long size)
area = __get_vm_area(size, VM_ALLOC, MEM_MODULE_START, MEM_MODULE_END);
if (!area)
goto error;
+ area->nr_pages = npages;
+ area->pages = pages;

if (map_vm_area(area, prot_rwx, &pages)) {
vunmap(area->addr);
--
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/