2003-03-06 21:47:40

by Andreas Klein

[permalink] [raw]
Subject: ioremap off by one bug


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
[email protected]
root / webmaster @cip.physik.uni-wuerzburg.de
root / webmaster @http://www.physik.uni-wuerzburg.de
_____________________________________
| |
| Long live our gracious AMIGA! |
|___________________________________|