aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/hugetlb.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 08b7595fe3c1..a13be48b818b 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1037,11 +1037,8 @@ free:
1037 spin_unlock(&hugetlb_lock); 1037 spin_unlock(&hugetlb_lock);
1038 1038
1039 /* Free unnecessary surplus pages to the buddy allocator */ 1039 /* Free unnecessary surplus pages to the buddy allocator */
1040 if (!list_empty(&surplus_list)) { 1040 list_for_each_entry_safe(page, tmp, &surplus_list, lru)
1041 list_for_each_entry_safe(page, tmp, &surplus_list, lru) { 1041 put_page(page);
1042 put_page(page);
1043 }
1044 }
1045 spin_lock(&hugetlb_lock); 1042 spin_lock(&hugetlb_lock);
1046 1043
1047 return ret; 1044 return ret;