From: Ken Chen Date: Tue, 24 Jul 2007 01:44:00 +0000 (-0700) Subject: fix hugetlb page allocation leak X-Git-Tag: v2.6.23-rc2~301 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ab3ee7b1cd5c91eb2272764f9d7d1fe4749681e;p=linux-2.6 fix hugetlb page allocation leak dequeue_huge_page() has a serious memory leak upon hugetlb page allocation. The for loop continues on allocating hugetlb pages out of all allowable zone, where this function is supposedly only dequeue one and only one pages. Fixed it by breaking out of the for loop once a hugetlb page is found. Signed-off-by: Ken Chen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f127940ec2..d7ca59d66c 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -84,6 +84,7 @@ static struct page *dequeue_huge_page(struct vm_area_struct *vma, list_del(&page->lru); free_huge_pages--; free_huge_pages_node[nid]--; + break; } } return page;