From: Hillf Danton Date: Fri, 2 Dec 2011 03:06:50 +0000 (+1100) Subject: mm/migrate.c: pair unlock_page() and lock_page() when migrating huge pages X-Git-Tag: next-20111202~2^2~228 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=720ea6a6cfef9e2c256f36f1ae2c0a2ff4177781;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);