Jesper Juhl 32d6feadf4 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>
2011-01-13 17:32:48 -08:00
..
2009-04-01 08:59:13 -07:00
2011-01-13 17:32:42 -08:00
2010-08-08 21:57:23 +01:00
2011-01-13 17:32:48 -08:00
2011-01-13 17:32:42 -08:00
2011-01-13 17:32:47 -08:00
2011-01-13 17:32:43 -08:00
2011-01-13 17:32:47 -08:00
2009-09-22 07:17:35 -07:00
2010-03-24 16:31:21 -07:00
2011-01-13 17:32:46 -08:00
2011-01-13 17:32:41 -08:00
2010-05-21 18:31:21 -04:00
2011-01-13 17:32:43 -08:00
2011-01-13 17:32:41 -08:00
2010-05-25 08:07:00 -07:00
2011-01-07 17:50:26 +11:00
2011-01-13 17:32:33 -08:00
2011-01-13 17:32:43 -08:00
2011-01-13 17:32:41 -08:00
2011-01-13 17:32:42 -08:00
2011-01-13 17:32:41 -08:00
2009-06-23 12:50:05 -07:00
2011-01-13 17:32:36 -08:00
2011-01-13 17:32:43 -08:00