diff --git a/mm/huge_memory.c b/mm/huge_memory.c index c89c1193c64d..c615e81620b9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2331,8 +2331,8 @@ bool madvise_free_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, goto out; if (unlikely(!pmd_present(orig_pmd))) { - VM_BUG_ON(thp_migration_supported() && - !pmd_is_migration_entry(orig_pmd)); + VM_WARN_ON_ONCE(!pmd_is_migration_entry(orig_pmd) && + !pmd_is_device_private_entry(orig_pmd)); goto out; }