diff --git a/mm/memory.c b/mm/memory.c index 56057f97afaf..24463fd7de64 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -5514,7 +5514,7 @@ retry: * concurrent mremap() with MREMAP_DONTUNMAP could dissociate the VMA * from its anon_vma. */ - if (unlikely(!vma->anon_vma)) + if (vma_is_anonymous(vma) && !vma->anon_vma) goto inval_end_read; /* Check since vm_start/vm_end might change before we lock the VMA */