From aa0fceab26e04878e811d8128823e30e32ec33f5 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Mon, 10 Apr 2017 17:09:15 +1000 Subject: mm/migrate: allow migrate_vma() to alloc new page on empty entry fix Signed-off-by: Stephen Rothwell --- mm/migrate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index e4b555f9a689..7958dfa01b16 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2478,6 +2478,7 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate, struct mem_cgroup *memcg; spinlock_t *ptl; pgd_t *pgdp; + p4d_t *p4dp; pud_t *pudp; pmd_t *pmdp; pte_t *ptep; @@ -2488,7 +2489,10 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate, goto abort; pgdp = pgd_offset(mm, addr); - pudp = pud_alloc(mm, pgdp, addr); + p4dp = p4d_alloc(mm, pgdp, addr); + if (!p4dp) + goto abort; + pudp = pud_alloc(mm, p4dp, addr); if (!pudp) goto abort; pmdp = pmd_alloc(mm, pudp, addr); -- cgit v1.2.3