Merge branch 'drm-next-4.7' of git://people.freedesktop.org/~agd5f/linux into drm...
[deliverable/linux.git] / mm / mmap.c
index 420088682d4ac8d96ceb0f7eb5993d8984758773..d3d9a94ca03119919bc36629c6656b43cf6db44d 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2494,11 +2494,9 @@ int vm_munmap(unsigned long start, size_t len)
        int ret;
        struct mm_struct *mm = current->mm;
 
-       /*
-        * XXX convert to down_write_killable as soon as all users are able
-        * to handle the error.
-        */
-       down_write(&mm->mmap_sem);
+       if (down_write_killable(&mm->mmap_sem))
+               return -EINTR;
+
        ret = do_munmap(mm, start, len);
        up_write(&mm->mmap_sem);
        return ret;
@@ -2714,12 +2712,9 @@ unsigned long vm_brk(unsigned long addr, unsigned long len)
        unsigned long ret;
        bool populate;
 
-       /*
-        * XXX not all users are chcecking the return value, convert
-        * to down_write_killable after they are able to cope with
-        * error
-        */
-       down_write(&mm->mmap_sem);
+       if (down_write_killable(&mm->mmap_sem))
+               return -EINTR;
+
        ret = do_brk(addr, len);
        populate = ((mm->def_flags & VM_LOCKED) != 0);
        up_write(&mm->mmap_sem);
This page took 0.034029 seconds and 5 git commands to generate.