Skip to content

Commit 584cff5

Browse files
Kautuk Consultorvalds
authored andcommitted
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>
1 parent 09f363c commit 584cff5

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

‎mm/mmap.c‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2558,7 +2558,6 @@ int mm_take_all_locks(struct mm_struct *mm)
25582558
{
25592559
struct vm_area_struct *vma;
25602560
struct anon_vma_chain *avc;
2561-
int ret = -EINTR;
25622561

25632562
BUG_ON(down_read_trylock(&mm->mmap_sem));
25642563

@@ -2579,13 +2578,11 @@ int mm_take_all_locks(struct mm_struct *mm)
25792578
vm_lock_anon_vma(mm, avc->anon_vma);
25802579
}
25812580

2582-
ret = 0;
2581+
return 0;
25832582

25842583
out_unlock:
2585-
if (ret)
2586-
mm_drop_all_locks(mm);
2587-
2588-
return ret;
2584+
mm_drop_all_locks(mm);
2585+
return -EINTR;
25892586
}
25902587

25912588
static void vm_unlock_anon_vma(struct anon_vma *anon_vma)

0 commit comments

Comments
 (0)