[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210619093151.1492174-6-linmiaohe@huawei.com>
Date: Sat, 19 Jun 2021 17:31:50 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: <akpm@...ux-foundation.org>
CC: <vitalywool@...il.com>, <linux-kernel@...r.kernel.org>,
<linux-mm@...ck.org>, <linmiaohe@...wei.com>
Subject: [PATCH 5/6] mm/z3fold: fix potential memory leak in z3fold_destroy_pool()
There is a memoryleak in z3fold_destroy_pool() as it forgets to free_percpu
pool->unbuddied. Call free_percpu for pool->unbuddied to fix this issue.
Fixes: d30561c56f41 ("z3fold: use per-cpu unbuddied lists")
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
mm/z3fold.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/z3fold.c b/mm/z3fold.c
index bab08c08bf19..196d886a3436 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1048,6 +1048,7 @@ static void z3fold_destroy_pool(struct z3fold_pool *pool)
destroy_workqueue(pool->compact_wq);
destroy_workqueue(pool->release_wq);
z3fold_unregister_migration(pool);
+ free_percpu(pool->unbuddied);
kfree(pool);
}
--
2.23.0
Powered by blists - more mailing lists