Skip to content

Commit

Permalink
alloc_vmap_area: fix memory leak
Browse files Browse the repository at this point in the history
If alloc_vmap_area() fails the allocated struct vmap_area has to be freed.

Signed-off-by: Ralph Wuerthner <ralphw@linux.vnet.ibm.com>
Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Ralph Wuerthner authored and Linus Torvalds committed May 6, 2009
1 parent ca1eda2 commit 2498ce4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/vmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
printk(KERN_WARNING
"vmap allocation for size %lu failed: "
"use vmalloc=<size> to increase size.\n", size);
kfree(va);
return ERR_PTR(-EBUSY);
}

Expand Down

0 comments on commit 2498ce4

Please sign in to comment.