diff options
-rw-r--r-- | mm/vmalloc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 9d68ac51a19d..c3af9b28e54f 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -478,6 +478,9 @@ static int vmap_pages_pte_range(pmd_t *pmd, unsigned long addr, return -EBUSY; if (WARN_ON(!page)) return -ENOMEM; + if (WARN_ON(!pfn_valid(page_to_pfn(page)))) + return -EINVAL; + set_pte_at(&init_mm, addr, pte, mk_pte(page, prot)); (*nr)++; } while (pte++, addr += PAGE_SIZE, addr != end); |