Commit f4196e0e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix ioremap off by one bug

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).
parent 3d7aa86c
......@@ -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..
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment