ioremap off by one bug

Andreas Klein (asklein@cip.physik.uni-wuerzburg.de)
Thu, 6 Mar 2003 22:58:09 +0100 (MET)


Hello,

we have found an off by one bug in ioremap.
The following patch fixes the problem.

--- arch/i386/mm/ioremap.c.orig 2003-03-06 23:16:12.000000000 +0100
+++ arch/i386/mm/ioremap.c 2003-03-06 23:16:30.000000000 +0100
@@ -142,7 +142,7 @@
*/
offset = phys_addr & ~PAGE_MASK;
phys_addr &= PAGE_MASK;
- size = PAGE_ALIGN(last_addr) - phys_addr;
+ size = PAGE_ALIGN(last_addr+1) - phys_addr;

/*
* Ok, go for it..

bye,

-- Andreas Klein
asklein@cip.physik.uni-wuerzburg.de
root / webmaster @cip.physik.uni-wuerzburg.de
root / webmaster @www.physik.uni-wuerzburg.de
_____________________________________
| |
| Long live our gracious AMIGA! |
|___________________________________|

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