Skip to contentSkip to conversation

alloc_vmap_area: fix memory leak

PATCH In review Ralph Wuerthner 3 participants 3 messages May 4, 2009 – May 5, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alloc_vmap_area: fix memory leak

[PATCH] alloc_vmap_area: fix memory leak

From: Ralph Wuerthner <[email protected]>

If alloc_vmap_area() fails the allocated struct vmap_area has to be freed.

---
 mm/vmalloc.c |    1 +
 1 file changed, 1 insertion(+)
mm/vmalloc.c +1 -0
Index: 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);
 	}
 
Signature · 7 lines
Ralph Wuerthner

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Reviewed-by
#2 lore raw

Nice catch!
Looks good to me.

Quoted 9 lines · Christoph Lameter

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

Signature · 8 lines
Thanks,
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>