linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] alloc_vmap_area: fix memory leak
@ 2009-05-04 14:37 Ralph Wuerthner
  2009-05-04 16:15 ` Christoph Lameter
  0 siblings, 1 reply; 3+ messages in thread
From: Ralph Wuerthner @ 2009-05-04 14:37 UTC (permalink / raw)
  To: linux-mm, linux-kernel

[PATCH] alloc_vmap_area: fix memory leak

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

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

Signed-off-by: Ralph Wuerthner <ralphw@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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] alloc_vmap_area: fix memory leak
  2009-05-04 14:37 [PATCH] alloc_vmap_area: fix memory leak Ralph Wuerthner
@ 2009-05-04 16:15 ` Christoph Lameter
  2009-05-05  1:00   ` Minchan Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Lameter @ 2009-05-04 16:15 UTC (permalink / raw)
  To: Ralph Wuerthner; +Cc: linux-mm, akpm, linux-kernel


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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] alloc_vmap_area: fix memory leak
  2009-05-04 16:15 ` Christoph Lameter
@ 2009-05-05  1:00   ` Minchan Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Minchan Kim @ 2009-05-05  1:00 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: Ralph Wuerthner, linux-mm, akpm, linux-kernel, Nick Piggin

Nice catch!
Looks good to me.

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

On Tue, May 5, 2009 at 1:15 AM, Christoph Lameter <cl@linux.com> wrote:
>
> Reviewed-by: Christoph Lameter <cl@linux-foundation.org>
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>



-- 
Thanks,
Minchan Kim

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-05-05  1:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-04 14:37 [PATCH] alloc_vmap_area: fix memory leak Ralph Wuerthner
2009-05-04 16:15 ` Christoph Lameter
2009-05-05  1:00   ` Minchan Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).