[PATCH] alloc_vmap_area: fix memory leak
From: Ralph Wuerthner
Date: Mon May 04 2009 - 10:37:59 EST
[PATCH] alloc_vmap_area: fix memory leak
From: Ralph Wuerthner <ralphw@xxxxxxxxxxxxxxxxxx>
If alloc_vmap_area() fails the allocated struct vmap_area has to be
freed.
Signed-off-by: Ralph Wuerthner <ralphw@xxxxxxxxxxxxxxxxxx>
---
mm/vmalloc.c | 1 +
1 file changed, 1 insertion(+)
Index: linux-2.6/mm/vmalloc.c
===================================================================
--- linux-2.6.orig/mm/vmalloc.c
+++ linux-2.6/mm/vmalloc.c
@@ -402,6 +402,7 @@ overflow:
printk(KERN_WARNING
"vmap allocation for size %lu failed: "
"use vmalloc=<size> to increase size.\n", size);
+ kfree(va);
return ERR_PTR(-EBUSY);
}
--
Ralph Wuerthner
--
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/