Skip to content

Commit

Permalink
mm/migrate.c: pair unlock_page() and lock_page() when migrating huge …
Browse files Browse the repository at this point in the history
…pages

Avoid unlocking and unlocked page if we failed to lock it.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Hillf Danton authored and torvalds committed Dec 9, 2011
1 parent 58a84aa commit 0976133
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,9 +871,9 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,

if (anon_vma)
put_anon_vma(anon_vma);
out:
unlock_page(hpage);

out:
if (rc != -EAGAIN) {
list_del(&hpage->lru);
put_page(hpage);
Expand Down

0 comments on commit 0976133

Please sign in to comment.