lkml.org 
[lkml]   [2001]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] free_page(0) freed pagenr 0x40000
sys_mount(), and probably others, calls free_page(0) when
no page was got. free_pages() allows for this explicitly if
CONFIG_DISCONTIGMEM, and _appears_ to allow for it generally
by testing VALID_PAGE() - but that test is inadequate, if
over 1GB of memory then pagenr 0x40000 can be wrongly freed
(in i386 case). Complicate the test, for what? or simply...

--- linux-2.4.1-pre2/mm/page_alloc.c Thu Jan 11 13:44:43 2001
+++ linux/mm/page_alloc.c Thu Jan 11 21:41:39 2001
@@ -542,14 +542,8 @@

void free_pages(unsigned long addr, unsigned long order)
{
- struct page *fpage;
-
-#ifdef CONFIG_DISCONTIGMEM
- if (addr == 0) return;
-#endif
- fpage = virt_to_page(addr);
- if (VALID_PAGE(fpage))
- __free_pages(fpage, order);
+ if (addr != 0)
+ __free_pages(virt_to_page(addr), order);
}

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.024 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site