linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ioremap off by one bug
@ 2003-03-06 21:58 Andreas Klein
  0 siblings, 0 replies; only message in thread
From: Andreas Klein @ 2003-03-06 21:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: torvalds, mantel


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!   |
|___________________________________|




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

only message in thread, other threads:[~2003-03-06 21:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-06 21:58 ioremap off by one bug Andreas Klein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).