aboutsummaryrefslogtreecommitdiff
path: root/mm/swapfile.c
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2012-05-29 15:06:50 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-29 16:22:24 -0700
commit181eb39425f2b9275afcb015eaa547d11f71a02f (patch)
tree0ce0f09b5a86931e580a0a6b88e546831c7318ed /mm/swapfile.c
parent4e2f07750d9a94e8f23e86408df5ab95be88bf11 (diff)
mm/memblock: fix memory leak on extending regions
The overall memblock has been organized into the memory regions and reserved regions. Initially, the memory regions and reserved regions are stored in the predetermined arrays of "struct memblock _region". It's possible for the arrays to be enlarged when we have newly added regions, but no free space left there. The policy here is to create double-sized array either by slab allocator or memblock allocator. Unfortunately, we didn't free the old array, which might be allocated through slab allocator before. That would cause memory leak. The patch introduces 2 variables to trace where (slab or memblock) the memory and reserved regions come from. The memory for the memory or reserved regions will be deallocated by kfree() if that was allocated by slab allocator. Thus to fix the memory leak issue. Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/swapfile.c')
0 files changed, 0 insertions, 0 deletions