diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index d00ac179d973..81dfc26bfae8 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -2500,9 +2500,11 @@ static void make_uffd_wp_huge_pte(struct vm_area_struct *vma, const unsigned long psize = huge_page_size(hstate_vma(vma)); softleaf_t entry; - if (huge_pte_none(ptent)) + if (huge_pte_none(ptent)) { set_huge_pte_at(vma->vm_mm, addr, ptep, make_pte_marker(PTE_MARKER_UFFD_WP), psize); + return; + } entry = softleaf_from_pte(ptent); if (softleaf_is_hwpoison(entry) || softleaf_is_marker(entry))