Skip to content

Commit

Permalink
mm/mmap.c: eliminate the ret variable from mm_take_all_locks()
Browse files Browse the repository at this point in the history
The ret variable is really not needed in mm_take_all_locks().

Signed-off-by: Kautuk Consul <[email protected]>
Reviewed-by: Michal Hocko <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Kautuk Consul authored and torvalds committed Nov 1, 2011
1 parent 09f363c commit 584cff5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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)
Expand Down

0 comments on commit 584cff5

Please sign in to comment.