diff --git a/mm/filemap.c b/mm/filemap.c index 2d930470aaca..d633ab8cd56f 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -3319,7 +3319,7 @@ static bool filemap_map_pmd(struct vm_fault *vmf, struct page *page) } } - if (pmd_none(*vmf->pmd)) + if (pmd_none(*vmf->pmd) && vmf->prealloc_pte) pmd_install(mm, vmf->pmd, &vmf->prealloc_pte); /* See comment in handle_pte_fault() */