]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix ioremap off by one bug
authorAndrew Morton <akpm@digeo.com>
Thu, 6 Mar 2003 09:15:02 +0000 (01:15 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 6 Mar 2003 09:15:02 +0000 (01:15 -0800)
Patch from Andreas Klein <asklein@cip.physik.uni-wuerzburg.de>

Fixes an off-by-one in ioremap() - local variable `last_addr' is *inclusive*
- it is the last byte of the mapping, not the usual (last byte + 1).

arch/i386/mm/ioremap.c

index f5ed94a11bce399242c903ecc9673f9ab4ffe1ed..335410b564233456327136168a3238a11d943bd5 100644 (file)
@@ -148,7 +148,7 @@ void * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flag
         */
        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..