diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c index 72a260007996..17c1c28e3491 100644 --- a/arch/x86/mm/pat/set_memory.c +++ b/arch/x86/mm/pat/set_memory.c @@ -1747,7 +1747,11 @@ static int populate_pgd(struct cpa_data *cpa, unsigned long addr) pgd_entry = cpa->pgd + pgd_index(addr); if (pgd_none(*pgd_entry)) { - p4d = (p4d_t *)get_zeroed_page(GFP_KERNEL); + /* + * Pass 0 as a placeholder for the second argument, since the + * generic implementation of p4d_alloc_one() does not use it. + */ + p4d = p4d_alloc_one(&init_mm, 0); if (!p4d) return -1; @@ -1759,7 +1763,11 @@ static int populate_pgd(struct cpa_data *cpa, unsigned long addr) */ p4d = p4d_offset(pgd_entry, addr); if (p4d_none(*p4d)) { - pud = (pud_t *)get_zeroed_page(GFP_KERNEL); + /* + * Pass 0 as a placeholder for the second argument, since the + * generic implementation of pud_alloc_one() does not use it. + */ + pud = pud_alloc_one(&init_mm, 0); if (!pud) return -1;