From: Hillf Danton Date: Thu, 8 Dec 2011 22:34:20 +0000 (-0800) Subject: mm/migrate.c: pair unlock_page() and lock_page() when migrating huge pages X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=09761333ed47e899cc1482c13090b95f3f711971;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.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 Signed-off-by: Linus Torvalds --- 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);