Commit 4d0d9bed authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] hugetlb.c: use safe iterator

From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>

With list poisoning on by default from linux-2.6.7, it's easier than ever to
trigger the bug in try_to_free_low().  It ought to use the safe version of
list iterater.
Signed-off-by: default avatarKen Chen <kenneth.w.chen@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0995a825
...@@ -134,8 +134,8 @@ static int try_to_free_low(unsigned long count) ...@@ -134,8 +134,8 @@ static int try_to_free_low(unsigned long count)
{ {
int i; int i;
for (i = 0; i < MAX_NUMNODES; ++i) { for (i = 0; i < MAX_NUMNODES; ++i) {
struct page *page; struct page *page, *next;
list_for_each_entry(page, &hugepage_freelists[i], lru) { list_for_each_entry_safe(page, next, &hugepage_freelists[i], lru) {
if (PageHighMem(page)) if (PageHighMem(page))
continue; continue;
list_del(&page->lru); list_del(&page->lru);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment