diff options
author | Ken Chen <kenchen@google.com> | 2007-07-23 21:44:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-24 15:24:59 -0400 |
commit | 5ab3ee7b1cd5c91eb2272764f9d7d1fe4749681e (patch) | |
tree | 82c1fbc5e3a41651d4c0d45cf13d85760708c184 /mm/hugetlb.c | |
parent | be1ff386e768ee4fc19bb7da48cee4fc4cb4e75b (diff) |
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 <kenchen@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r-- | mm/hugetlb.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f127940ec24f..d7ca59d66c59 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -84,6 +84,7 @@ static struct page *dequeue_huge_page(struct vm_area_struct *vma, | |||
84 | list_del(&page->lru); | 84 | list_del(&page->lru); |
85 | free_huge_pages--; | 85 | free_huge_pages--; |
86 | free_huge_pages_node[nid]--; | 86 | free_huge_pages_node[nid]--; |
87 | break; | ||
87 | } | 88 | } |
88 | } | 89 | } |
89 | return page; | 90 | return page; |