Messages in this thread Patch in this message |  | | From | Xidong Wang <> | Subject | [PATCH 1/1] z3fold: fix memory leak | Date | Wed, 4 Apr 2018 08:51:51 +0800 |
| |
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@163.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
|  |