From: Jesper Juhl Date: Thu, 13 Jan 2011 23:47:22 +0000 (-0800) Subject: mm/hugetlb.c: fix error-path memory leak in nr_hugepages_store_common() X-Git-Tag: v2.6.38-rc1~97 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32d6feadf4e17ea9b98071be9bbf402a74a4f818;p=pandora-kernel.git 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 Cc: Minchan Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed