[PATCH] percpu : fix the memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Huang Shijie <shijie8@xxxxxxxxx>
---
 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@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]