mm: numa: do not dereference pmd outside of the lock during NUMA hinting fault
[cascardo/linux.git] / mm / huge_memory.c
index cb7be11..c692136 100644 (file)
@@ -1272,8 +1272,9 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
         * check_same as the page may no longer be mapped.
         */
        if (unlikely(pmd_trans_migrating(*pmdp))) {
+               page = pmd_page(*pmdp);
                spin_unlock(ptl);
-               wait_migrate_huge_page(vma->anon_vma, pmdp);
+               wait_on_page_locked(page);
                goto out;
        }