linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Huang Shijie <shijie8@gmail.com>
To: akpm@linux-foundation.org
Cc: tj@kernel.org, linux-mm@kvack.org, Huang Shijie <shijie8@gmail.com>
Subject: [PATCH] percpu : fix the memory leak
Date: Sun,  8 Aug 2010 17:53:17 +0800	[thread overview]
Message-ID: <1281261197-8816-1-git-send-email-shijie8@gmail.com> (raw)

	The origin code did not free the old map.
The patch fixes it.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
---
 mm/percpu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/mm/percpu.c b/mm/percpu.c
index e61dc2c..d1c94e3 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -393,6 +393,7 @@ static int pcpu_extend_area_map(struct pcpu_chunk *chunk, int new_alloc)
 		goto out_unlock;
 
 	old_size = chunk->map_alloc * sizeof(chunk->map[0]);
+	old	 = chunk->map;
 	memcpy(new, chunk->map, old_size);
 
 	chunk->map_alloc = new_alloc;
-- 
1.6.6.1

--
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:[~2010-08-08  9:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-08  9:53 Huang Shijie [this message]
2010-08-08 12:42 ` [PATCH] percpu: fix a memory leak in pcpu_extend_area_map() Tejun Heo
2010-08-26 22:10   ` Andrew Morton
2010-08-27  9:32     ` Tejun Heo
2010-09-16 21:36   ` breaks 2.6.32.21+ (was: [PATCH] percpu: fix a memory leak in pcpu_extend_area_map()) Peter Palfrader
2010-09-16 23:13     ` [stable] " Greg KH
2010-09-17 13:47       ` [stable] breaks 2.6.32.21+ Tejun Heo
2010-09-17 16:36         ` Greg KH

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=1281261197-8816-1-git-send-email-shijie8@gmail.com \
    --to=shijie8@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=tj@kernel.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).