lkml.org 
[lkml]   [2000]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 2.2.18pre2: fencepost error in __ioremap() [AGP]
The AGP patches add some code to __ioremap.  That code seems to me to
have a fencepost error.

In the below hunk, note that temp_end is set to "temp_addr+(size-1)".
It points _at_ the last page to be examined, not beyond it. So the
loop should be controlled by a "<=" test, not a "<" test. Without
this patch, the last page in the range is not tested for reservation.

Index: arch/i386/mm/ioremap.c
--- arch/i386/mm/ioremap.c.prev
+++ arch/i386/mm/ioremap.c Fri Sep 1 20:11:25 2000
@@ -118,5 +118,5 @@ void * __ioremap(unsigned long phys_addr
temp_end = temp_addr + (size - 1);

- for(i = MAP_NR(temp_addr); i < MAP_NR(temp_end); i++) {
+ for(i = MAP_NR(temp_addr); i <= MAP_NR(temp_end); i++) {
if(!PageReserved(mem_map + i))
return NULL;
--
Chip Salzenberg - a.k.a. - <chip@valinux.com>
"I wanted to play hopscotch with the impenetrable mystery of existence,
but he stepped in a wormhole and had to go in early." // MST3K
-
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 12:38    [W:0.024 / U:34.204 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site