diff options
-rw-r--r-- | mm/hugetlb.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 9595278b5ab4..82321da23cc3 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -400,8 +400,10 @@ static void clear_huge_page(struct page *page, | |||
400 | { | 400 | { |
401 | int i; | 401 | int i; |
402 | 402 | ||
403 | if (unlikely(sz > MAX_ORDER_NR_PAGES)) | 403 | if (unlikely(sz > MAX_ORDER_NR_PAGES)) { |
404 | return clear_gigantic_page(page, addr, sz); | 404 | clear_gigantic_page(page, addr, sz); |
405 | return; | ||
406 | } | ||
405 | 407 | ||
406 | might_sleep(); | 408 | might_sleep(); |
407 | for (i = 0; i < sz/PAGE_SIZE; i++) { | 409 | for (i = 0; i < sz/PAGE_SIZE; i++) { |
@@ -433,8 +435,10 @@ static void copy_huge_page(struct page *dst, struct page *src, | |||
433 | int i; | 435 | int i; |
434 | struct hstate *h = hstate_vma(vma); | 436 | struct hstate *h = hstate_vma(vma); |
435 | 437 | ||
436 | if (unlikely(pages_per_huge_page(h) > MAX_ORDER_NR_PAGES)) | 438 | if (unlikely(pages_per_huge_page(h) > MAX_ORDER_NR_PAGES)) { |
437 | return copy_gigantic_page(dst, src, addr, vma); | 439 | copy_gigantic_page(dst, src, addr, vma); |
440 | return; | ||
441 | } | ||
438 | 442 | ||
439 | might_sleep(); | 443 | might_sleep(); |
440 | for (i = 0; i < pages_per_huge_page(h); i++) { | 444 | for (i = 0; i < pages_per_huge_page(h); i++) { |