summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKautuk Consul <consul.kautuk@gmail.com>2011-11-01 04:08:59 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-01 04:30:49 +0400
commit584cff54e1ff8f59d5109dc8093efedff8bcc375 (patch)
tree464c9acb8bf22bf3a052fef23d3fd9f4f892da4a
parent09f363c7363eb10cfb4b82094bd7064e5608258b (diff)
downloadlinux-584cff54e1ff8f59d5109dc8093efedff8bcc375.tar.xz
mm/mmap.c: eliminate the ret variable from mm_take_all_locks()
The ret variable is really not needed in mm_take_all_locks(). Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com> Reviewed-by: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/mmap.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index a65efd4db3e1..3c0061f744f5 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2558,7 +2558,6 @@ int mm_take_all_locks(struct mm_struct *mm)
{
struct vm_area_struct *vma;
struct anon_vma_chain *avc;
- int ret = -EINTR;
BUG_ON(down_read_trylock(&mm->mmap_sem));
@@ -2579,13 +2578,11 @@ int mm_take_all_locks(struct mm_struct *mm)
vm_lock_anon_vma(mm, avc->anon_vma);
}
- ret = 0;
+ return 0;
out_unlock:
- if (ret)
- mm_drop_all_locks(mm);
-
- return ret;
+ mm_drop_all_locks(mm);
+ return -EINTR;
}
static void vm_unlock_anon_vma(struct anon_vma *anon_vma)