diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2021-02-24 23:06:50 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-04 12:26:39 +0300 |
commit | c200f4959586117d9a30c8eb94449ed3ffdb1e4e (patch) | |
tree | f1d7fb7d4b40c976b7d2b4900d3110da459a5688 /mm/compaction.c | |
parent | 67a982ee20d20e112f15eff98592a718de7c652e (diff) | |
download | linux-c200f4959586117d9a30c8eb94449ed3ffdb1e4e.tar.xz |
mm/hugetlb: fix potential double free in hugetlb_register_node() error path
[ Upstream commit cc2205a67dec5a700227a693fc113441e73e4641 ]
In hugetlb_sysfs_add_hstate(), we would do kobject_put() on hstate_kobjs
when failed to create sysfs group but forget to set hstate_kobjs to NULL.
Then in hugetlb_register_node() error path, we may free it again via
hugetlb_unregister_node().
Link: https://lkml.kernel.org/r/20210107123249.36964-1-linmiaohe@huawei.com
Fixes: a3437870160c ("hugetlb: new sysfs interface")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Muchun Song <smuchun@gmail.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>
Diffstat (limited to 'mm/compaction.c')
0 files changed, 0 insertions, 0 deletions