diff options
author | Ganesh Mahendran <opensource.ganesh@gmail.com> | 2014-12-12 16:57:10 -0800 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-01-05 18:22:02 +0100 |
commit | 521046e9faaf950194bd7253af92549d412fcc00 (patch) | |
tree | 32d8f3b0c0a94d01d72b6066a3d797d29d428535 /mm | |
parent | 4c343b9525f92479071373b56d179a08d216ade5 (diff) | |
download | kernel_samsung_tuna-521046e9faaf950194bd7253af92549d412fcc00.zip kernel_samsung_tuna-521046e9faaf950194bd7253af92549d412fcc00.tar.gz kernel_samsung_tuna-521046e9faaf950194bd7253af92549d412fcc00.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.c | 5 |
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; |