mm: check for no mmaps in exit_mmap()
[sfrench/cifs-2.6.git] / mm / mmap.c
index 1f97d8aa9b05fa16784cf0f8870bd3ba66f225b5..a910c045cfd4241601306257c8822bda7f1ee05a 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2090,6 +2090,9 @@ void exit_mmap(struct mm_struct *mm)
        arch_exit_mmap(mm);
        mmu_notifier_release(mm);
 
+       if (!mm->mmap)  /* Can happen if dup_mmap() received an OOM */
+               return;
+
        if (mm->locked_vm) {
                vma = mm->mmap;
                while (vma) {