提交 adb7a3b8 编写于 作者: L Liu Shixin

mm/dynamic_hugetlb: fix type error of pfn in __hpool_split_gigantic_page()

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6XOIE
CVE: NA

--------------------------------

The type of pfn is int, which can result in truncation.
Change its type to unsigned long to fix the problem.

Fixes: eef7b4fd ("mm/dynamic_hugetlb: use pfn to traverse subpages")
Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
上级 3a6c3c88
......@@ -55,7 +55,8 @@ static void __hpool_split_gigantic_page(struct dhugetlb_pool *hpool, struct page
{
int nr_pages = 1 << (PUD_SHIFT - PAGE_SHIFT);
int nr_blocks = 1 << (PMD_SHIFT - PAGE_SHIFT);
int i, pfn = page_to_pfn(page);
unsigned long pfn = page_to_pfn(page);
int i;
lockdep_assert_held(&hpool->lock);
atomic_set(compound_mapcount_ptr(page), 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册