Merge tag 'integrity-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar...
[linux-2.6-microblaze.git] / mm / migrate.c
index c0efe92..20ca887 100644 (file)
@@ -1280,6 +1280,12 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
                return -ENOSYS;
        }
 
+       if (page_count(hpage) == 1) {
+               /* page was freed from under us. So we are done. */
+               putback_active_hugepage(hpage);
+               return MIGRATEPAGE_SUCCESS;
+       }
+
        new_hpage = get_new_page(hpage, private);
        if (!new_hpage)
                return -ENOMEM;