From: Hillf Danton Date: Wed, 30 Nov 2011 04:03:03 +0000 (+1100) Subject: mm/migrate.c: pair unlock_page() and lock_page() when migrating huge pages X-Git-Tag: next-20111130~3^2~190 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=01c95e6f839830f4a51b2e9f41bcbdfcb00bdb68;p=karo-tx-linux.git mm/migrate.c: pair unlock_page() and lock_page() when migrating huge pages Avoid unlocking and unlocked page if we failed to lock it. Signed-off-by: Hillf Danton Cc: Naoya Horiguchi Cc: Andrea Arcangeli Signed-off-by: Andrew Morton --- diff --git a/mm/migrate.c b/mm/migrate.c index 578e29174fa6..177aca424a06 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -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);