diff mbox series

[5/6] mm/z3fold: fix potential memory leak in z3fold_destroy_pool()

Message ID 20210619093151.1492174-6-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series Cleanup and fixup for z3fold | expand

Commit Message

Miaohe Lin June 19, 2021, 9:31 a.m. UTC
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@huawei.com>
---
 mm/z3fold.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

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);
 }