aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorGanesh Mahendran <opensource.ganesh@gmail.com>2014-12-12 16:57:10 -0800
committerSimon Shields <keepcalm444@gmail.com>2016-06-12 21:20:17 +1000
commitd997b41417d94c22baaabd8d84a6a4f1e2e93fb9 (patch)
treef0106dd44e32980a1bd196743af265da3d4c70b5 /mm
parentf2eb4e82d2aecc5f8e2b7fa654a090284a51c9f2 (diff)
downloadkernel_samsung_smdk4412-d997b41417d94c22baaabd8d84a6a4f1e2e93fb9.zip
kernel_samsung_smdk4412-d997b41417d94c22baaabd8d84a6a4f1e2e93fb9.tar.gz
kernel_samsung_smdk4412-d997b41417d94c22baaabd8d84a6a4f1e2e93fb9.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;