mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Bug fix in mm/hugetlb.c - use safe iterater
@ 2004-06-22 21:01 Chen, Kenneth W
  0 siblings, 0 replies; only message in thread
From: Chen, Kenneth W @ 2004-06-22 21:01 UTC (permalink / raw)
  To: linux-kernel

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: Ken Chen <kenneth.w.chen@intel.com>


diff -Nurp linux-2.6.7.orig/mm/hugetlb.c linux-2.6.7/mm/hugetlb.c
--- linux-2.6.7.orig/mm/hugetlb.c	2004-06-15 22:19:37.000000000 -0700
+++ linux-2.6.7/mm/hugetlb.c	2004-06-22 13:45:11.000000000 -0700
@@ -134,8 +134,8 @@ static int try_to_free_low(unsigned long
 {
 	int i;
 	for (i = 0; i < MAX_NUMNODES; ++i) {
-		struct page *page;
-		list_for_each_entry(page, &hugepage_freelists[i], lru) {
+		struct page *page, *next;
+		list_for_each_entry_safe(page, next, &hugepage_freelists[i], lru) {
 			if (PageHighMem(page))
 				continue;
 			list_del(&page->lru);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-06-22 21:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-22 21:01 Bug fix in mm/hugetlb.c - use safe iterater Chen, Kenneth W

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®