mm/z3fold: fix potential memory leak in z3fold_destroy_pool()
BugLink: https://bugs.launchpad.net/bugs/1938199 [ Upstream commitdac0d1cfda
] 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:d30561c56f
("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> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
parent
879bb16f4c
commit
a8ce1a7061
mm
|
@ -839,6 +839,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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue