diff --git a/mm/migrate.c b/mm/migrate.c
index 34a9ad3e0a4f938747814ca0d51c9d59736ea1da..7e240437e7d9a8fa34f1f15d9d5709919fe9ea3e 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2068,7 +2068,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,
 	LIST_HEAD(migratepages);
 	new_page_t *new;
 	bool compound;
-	unsigned int nr_pages = thp_nr_pages(page);
+	int nr_pages = thp_nr_pages(page);
 
 	/*
 	 * PTE mapped THP or HugeTLB page can't reach here so the page could