summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2021-06-30 18:50:36 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-06-30 20:47:28 -0700
commitdac0d1cfda56472378d330b1b76b9973557a7b1d (patch)
treea617a57f322f388ad2f88cec22f2e700bb64ee3b /mm
parent767cc6c5568afa50ef6abbd4efb61beee56f9cc8 (diff)
downloadlinux-dac0d1cfda56472378d330b1b76b9973557a7b1d.tar.bz2
mm/z3fold: fix potential memory leak in z3fold_destroy_pool()
There is a memory leak in z3fold_destroy_pool() as it forgets to free_percpu pool->unbuddied. Call free_percpu for pool->unbuddied to fix this issue. Link: https://lkml.kernel.org/r/20210619093151.1492174-6-linmiaohe@huawei.com Fixes: d30561c56f41 ("z3fold: use per-cpu unbuddied lists") Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Vitaly Wool <vitaly.wool@konsulko.com> Cc: Hillf Danton <hdanton@sina.com> 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/z3fold.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/z3fold.c b/mm/z3fold.c
index 9a42172a1bcd..f34130ff093d 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1046,6 +1046,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);
}