From: Andrea Arcangeli Date: Fri, 8 Jan 2010 22:43:05 +0000 (-0800) Subject: mm: hugetlb: fix clear_huge_page() X-Git-Tag: v2.6.33-rc4~37 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=74dbdd239bb1348ad86d28b18574d9c1f28b62ca;p=karo-tx-linux.git mm: hugetlb: fix clear_huge_page() sz is in bytes, MAX_ORDER_NR_PAGES is in pages. Signed-off-by: Andrea Arcangeli Acked-by: David Gibson Cc: Mel Gorman Cc: David Rientjes Cc: Lee Schermerhorn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 65f38c218207..e91b81b63670 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -402,7 +402,7 @@ static void clear_huge_page(struct page *page, { int i; - if (unlikely(sz > MAX_ORDER_NR_PAGES)) { + if (unlikely(sz/PAGE_SIZE > MAX_ORDER_NR_PAGES)) { clear_gigantic_page(page, addr, sz); return; }