Free newly allocated thp if fail to isolate the old.

Signed-off-by: Hillf Danton <dhi...@gmail.com>
---

--- a/mm/migrate.c      Fri Nov 23 21:29:40 2012
+++ b/mm/migrate.c      Fri Nov 23 22:52:06 2012
@@ -1624,8 +1624,10 @@ int migrate_misplaced_transhuge_page(str
                goto out_dropref;

        isolated = numamigrate_isolate_page(pgdat, page);
-       if (!isolated)
+       if (!isolated) {
+               put_page(new_page);
                goto out_keep_locked;
+       }
        list_add(&page->lru, &migratepages);

        /* Prepare a page as a migration target */
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to