aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorGanesh Mahendran <opensource.ganesh@gmail.com>2014-12-12 16:57:10 -0800
committerAndreas Blaesius <skate4life@gmx.de>2016-06-05 21:21:55 +0200
commit581aaecd9b6c31b19a740db0c81983c468197a88 (patch)
treead3e3e5ee00443b9a35013e863a0ebc4663a7318 /mm
parent8f85a990349a1ee2864e84774b278b15ea5f0d3f (diff)
downloadkernel_samsung_espresso10-581aaecd9b6c31b19a740db0c81983c468197a88.zip
kernel_samsung_espresso10-581aaecd9b6c31b19a740db0c81983c468197a88.tar.gz
kernel_samsung_espresso10-581aaecd9b6c31b19a740db0c81983c468197a88.tar.bz2
mm/zsmalloc: allocate exactly size of struct zs_pool
In zs_create_pool(), we allocate memory more then sizeof(struct zs_pool) ovhd_size = roundup(sizeof(*pool), PAGE_SIZE); This patch allocate memory of exactly needed size. Change-Id: Id0ada356009c92bf791c94be073f4467f7bb1aac Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com> Acked-by: Minchan Kim <minchan@kernel.org> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Dan Streetman <ddstreet@ieee.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/zsmalloc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 7857a4a..5e17643 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -859,11 +859,10 @@ static bool can_merge(struct size_class *prev, int size, int pages_per_zspage)
*/
struct zs_pool *zs_create_pool(gfp_t flags)
{
- int i, ovhd_size;
+ int i;
struct zs_pool *pool;
- ovhd_size = roundup(sizeof(*pool), PAGE_SIZE);
- pool = kzalloc(ovhd_size, GFP_KERNEL);
+ pool = kzalloc(sizeof(*pool), GFP_KERNEL);
if (!pool)
return NULL;