linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] percpu : fix the memory leak
@ 2010-08-08  9:53 Huang Shijie
  2010-08-08 12:42 ` [PATCH] percpu: fix a memory leak in pcpu_extend_area_map() Tejun Heo
  0 siblings, 1 reply; 8+ messages in thread
From: Huang Shijie @ 2010-08-08  9:53 UTC (permalink / raw)
  To: akpm; +Cc: tj, linux-mm, Huang Shijie

	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>

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

end of thread, other threads:[~2010-09-17 16:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-08  9:53 [PATCH] percpu : fix the memory leak Huang Shijie
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

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).