Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[~shefty/rdma-dev.git] / arch / x86 / kernel / vm86_32.c
index a1315ab2d6b949f1287e3f132d0c7f705b0a9792..255f58ae71e8991838080eac595786a60f372a62 100644 (file)
@@ -172,6 +172,7 @@ static void mark_screen_rdonly(struct mm_struct *mm)
        spinlock_t *ptl;
        int i;
 
+       down_write(&mm->mmap_sem);
        pgd = pgd_offset(mm, 0xA0000);
        if (pgd_none_or_clear_bad(pgd))
                goto out;
@@ -190,6 +191,7 @@ static void mark_screen_rdonly(struct mm_struct *mm)
        }
        pte_unmap_unlock(pte, ptl);
 out:
+       up_write(&mm->mmap_sem);
        flush_tlb();
 }