]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/hugetlb: fix sysfs group leak in hugetlb_unregister_node()
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 16 Aug 2022 13:05:52 +0000 (21:05 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 17 Aug 2022 20:58:37 +0000 (13:58 -0700)
commit9322ef37f64d8c569492e5bf023f8a6d20f36598
tree33679d9e393176c3e68ad77837d14ac75835b821
parent04ac2d757731e6a83e3ec50a347f9a75c5a827c2
mm/hugetlb: fix sysfs group leak in hugetlb_unregister_node()

The sysfs group per_node_hstate_attr_group and hstate_demote_attr_group
when h->demote_order != 0 are created in hugetlb_register_node().  But
these sysfs groups are not removed when unregister the node, thus sysfs
group is leaked.  Using sysfs_remove_group() to fix this issue.

Link: https://lkml.kernel.org/r/20220816130553.31406-6-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb.c