summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2021-07-01 04:50:36 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-14 18:07:47 +0300
commitccb7848e23445afdc3432d6aa890d41f84f7538a (patch)
tree6c8847b3cccc93352de3c9f8d790e8026d71f3b5
parent093d3fc8cb238fa0b7377ccd5c02df378cc449ad (diff)
downloadlinux-ccb7848e23445afdc3432d6aa890d41f84f7538a.tar.xz
mm/z3fold: fix potential memory leak in z3fold_destroy_pool()
[ Upstream commit dac0d1cfda56472378d330b1b76b9973557a7b1d ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--mm/z3fold.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/z3fold.c b/mm/z3fold.c
index 7fe7adaaad01..33d8487ef6a8 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1059,6 +1059,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);
}