Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] alloc_vmap_area: fix memory leak

62 views
Skip to first unread message

Ralph Wuerthner

unread,
May 4, 2009, 10:40:11 AM5/4/09
to
[PATCH] alloc_vmap_area: fix memory leak

From: Ralph Wuerthner <ral...@linux.vnet.ibm.com>

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

Signed-off-by: Ralph Wuerthner <ral...@linux.vnet.ibm.com>

---
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 majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Christoph Lameter

unread,
May 4, 2009, 12:30:24 PM5/4/09
to

Reviewed-by: Christoph Lameter <c...@linux-foundation.org>

Minchan Kim

unread,
May 4, 2009, 9:10:12 PM5/4/09
to
Nice catch!
Looks good to me.

Reviewed-by: Minchan Kim <minch...@gmail.com>

On Tue, May 5, 2009 at 1:15 AM, Christoph Lameter <c...@linux.com> wrote:
>
> Reviewed-by: Christoph Lameter <c...@linux-foundation.org>
>
> --

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

--
Thanks,
Minchan Kim

0 new messages