Patch "mm/z3fold: fix potential memory leak in z3fold_destroy_pool()" has been added to the 5.13-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mm/z3fold: fix potential memory leak in z3fold_destroy_pool()

to the 5.13-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mm-z3fold-fix-potential-memory-leak-in-z3fold_destro.patch
and it can be found in the queue-5.13 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 886494f5187a2d4a3e275a055735a4bdfd83e86f
Author: Miaohe Lin <linmiaohe@xxxxxxxxxx>
Date:   Wed Jun 30 18:50:36 2021 -0700

    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@xxxxxxxxxx
    Fixes: d30561c56f41 ("z3fold: use per-cpu unbuddied lists")
    Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>
    Reviewed-by: Vitaly Wool <vitaly.wool@xxxxxxxxxxxx>
    Cc: Hillf Danton <hdanton@xxxxxxxx>
    Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux