diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 4b809cc7a3fdaf747d7b086eecefdf523cd39964..987d4b57ab0d7b16a869a8bc6b86f78389d923d7 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2014,8 +2014,7 @@ static int gather_surplus_pages(struct hstate *h, int delta)
 		 * This page is now managed by the hugetlb allocator and has
 		 * no users -- drop the buddy allocator's reference.
 		 */
-		put_page_testzero(page);
-		VM_BUG_ON_PAGE(page_count(page), page);
+		VM_BUG_ON_PAGE(!put_page_testzero(page), page);
 		enqueue_huge_page(h, page);
 	}
 free: