diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index ab171274ef217817291667bee226b45bebe259e3..2c5c9ee4220de4e9bb06addd6137ac0ce243d273 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -603,7 +603,6 @@ static unsigned long set_max_huge_pages(unsigned long count)
 	}
 
 	while (count > persistent_huge_pages) {
-		int ret;
 		/*
 		 * If this allocation races such that we no longer need the
 		 * page, free_huge_page will handle it by freeing the page