Merge branch 'net: struct netdev_rx_queue and xdp.h reshuffling'
[platform/kernel/linux-starfive.git] / mm / hugetlb.c
index bce28cc..64a3239 100644 (file)
@@ -7246,7 +7246,12 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma,
                                pte = (pte_t *)pmd_alloc(mm, pud, addr);
                }
        }
-       BUG_ON(pte && pte_present(ptep_get(pte)) && !pte_huge(ptep_get(pte)));
+
+       if (pte) {
+               pte_t pteval = ptep_get_lockless(pte);
+
+               BUG_ON(pte_present(pteval) && !pte_huge(pteval));
+       }
 
        return pte;
 }