mm/z3fold: fix potential memory leak in z3fold_destroy_pool()
authorMiaohe Lin <linmiaohe@huawei.com>
Thu, 1 Jul 2021 01:50:36 +0000 (18:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:51 +0000 (16:56 +0200)
commit0fe11b79c281850a58a0ec7cff78277b3ee63f62
tree569c4d11deafe2a51be3654fa5516702ad238a6f
parent555dffa4842b8df0d144d1862500ea5503c19209
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>
mm/z3fold.c