Commit 2498ce42 authored by Ralph Wuerthner's avatar Ralph Wuerthner Committed by Linus Torvalds

alloc_vmap_area: fix memory leak

If alloc_vmap_area() fails the allocated struct vmap_area has to be freed.
Signed-off-by: default avatarRalph Wuerthner <ralphw@linux.vnet.ibm.com>
Reviewed-by: default avatarChristoph Lameter <cl@linux-foundation.org>
Reviewed-by: default avatarMinchan Kim <minchan.kim@gmail.com>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ca1eda2d
...@@ -402,6 +402,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size, ...@@ -402,6 +402,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
printk(KERN_WARNING printk(KERN_WARNING
"vmap allocation for size %lu failed: " "vmap allocation for size %lu failed: "
"use vmalloc=<size> to increase size.\n", size); "use vmalloc=<size> to increase size.\n", size);
kfree(va);
return ERR_PTR(-EBUSY); return ERR_PTR(-EBUSY);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment