diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/hugetlb.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 757ca983fd99..92155db888b9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -565,7 +565,7 @@ static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid) | |||
565 | huge_page_order(h)); | 565 | huge_page_order(h)); |
566 | if (page) { | 566 | if (page) { |
567 | if (arch_prepare_hugepage(page)) { | 567 | if (arch_prepare_hugepage(page)) { |
568 | __free_pages(page, HUGETLB_PAGE_ORDER); | 568 | __free_pages(page, huge_page_order(h)); |
569 | return NULL; | 569 | return NULL; |
570 | } | 570 | } |
571 | prep_new_huge_page(h, page, nid); | 571 | prep_new_huge_page(h, page, nid); |
@@ -665,6 +665,11 @@ static struct page *alloc_buddy_huge_page(struct hstate *h, | |||
665 | __GFP_REPEAT|__GFP_NOWARN, | 665 | __GFP_REPEAT|__GFP_NOWARN, |
666 | huge_page_order(h)); | 666 | huge_page_order(h)); |
667 | 667 | ||
668 | if (page && arch_prepare_hugepage(page)) { | ||
669 | __free_pages(page, huge_page_order(h)); | ||
670 | return NULL; | ||
671 | } | ||
672 | |||
668 | spin_lock(&hugetlb_lock); | 673 | spin_lock(&hugetlb_lock); |
669 | if (page) { | 674 | if (page) { |
670 | /* | 675 | /* |