[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 4 Apr 2018 08:51:51 +0800
From: Xidong Wang <wangxidong_97@....com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Vitaly Wool <vitalywool@...il.com>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>
Cc: wangxidong_97@....com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/1] z3fold: fix memory leak
In function z3fold_create_pool(), the memory allocated by
__alloc_percpu() is not released on the error path that pool->compact_wq
, which holds the return value of create_singlethread_workqueue(), is NULL.
This will result in a memory leak bug.
Signed-off-by: Xidong Wang <wangxidong_97@....com>
---
mm/z3fold.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/z3fold.c b/mm/z3fold.c
index d589d31..b987cc5 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -490,6 +490,7 @@ static struct z3fold_pool *z3fold_create_pool(const char *name, gfp_t gfp,
out_wq:
destroy_workqueue(pool->compact_wq);
out:
+ free_percpu(pool->unbuddied);
kfree(pool);
return NULL;
}
--
2.7.4
Powered by blists - more mailing lists