summaryrefslogtreecommitdiff
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-01-13 15:47:22 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 17:32:48 -0800
commit32d6feadf4e17ea9b98071be9bbf402a74a4f818 (patch)
tree62427ca91992c87399211fec6294533fac0e7464 /mm/mmap.c
parent29c1f677d424e8c5683a837fc4f03fc9f19201d7 (diff)
downloadlwn-32d6feadf4e17ea9b98071be9bbf402a74a4f818.tar.gz
lwn-32d6feadf4e17ea9b98071be9bbf402a74a4f818.zip
mm/hugetlb.c: fix error-path memory leak in nr_hugepages_store_common()
The NODEMASK_ALLOC macro may dynamically allocate memory for its second argument ('nodes_allowed' in this context). In nr_hugepages_store_common() we may abort early if strict_strtoul() fails, but in that case we do not free the memory already allocated to 'nodes_allowed', causing a memory leak. This patch closes the leak by freeing the memory in the error path. [akpm@linux-foundation.org: use NODEMASK_FREE, per Minchan Kim] Signed-off-by: Jesper Juhl <jj@chaosbits.net> Cc: Minchan Kim <minchan.kim@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
0 files changed, 0 insertions, 0 deletions