diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-04-10 17:09:15 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-04-10 17:10:09 +1000 |
commit | aa0fceab26e04878e811d8128823e30e32ec33f5 (patch) | |
tree | 128df9cc8c600803680153c90e185669774f605b | |
parent | 0a62d30b18f1aa2e30ee68856ece0147b611f2dd (diff) |
mm/migrate: allow migrate_vma() to alloc new page on empty entry fix
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r-- | mm/migrate.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); |