linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ralph Wuerthner <ralphw@linux.vnet.ibm.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] alloc_vmap_area: fix memory leak
Date: Mon, 4 May 2009 16:37:31 +0200	[thread overview]
Message-ID: <20090504163731.3675ea87@rwuerthntp> (raw)

[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>

             reply	other threads:[~2009-05-04 14:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04 14:37 Ralph Wuerthner [this message]
2009-05-04 16:15 ` [PATCH] alloc_vmap_area: fix memory leak Christoph Lameter
2009-05-05  1:00   ` Minchan Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090504163731.3675ea87@rwuerthntp \
    --to=ralphw@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).