diff options
-rw-r--r-- | mm/swapfile.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index fbceed67a075..f2824c3c31b4 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -772,10 +772,8 @@ static int try_to_unuse(unsigned int type) | |||
772 | while (*swap_map > 1 && !retval && | 772 | while (*swap_map > 1 && !retval && |
773 | (p = p->next) != &start_mm->mmlist) { | 773 | (p = p->next) != &start_mm->mmlist) { |
774 | mm = list_entry(p, struct mm_struct, mmlist); | 774 | mm = list_entry(p, struct mm_struct, mmlist); |
775 | if (atomic_inc_return(&mm->mm_users) == 1) { | 775 | if (!atomic_inc_not_zero(&mm->mm_users)) |
776 | atomic_dec(&mm->mm_users); | ||
777 | continue; | 776 | continue; |
778 | } | ||
779 | spin_unlock(&mmlist_lock); | 777 | spin_unlock(&mmlist_lock); |
780 | mmput(prev_mm); | 778 | mmput(prev_mm); |
781 | prev_mm = mm; | 779 | prev_mm = mm; |