Skip to contentSkip to conversation

x86, iomap: Fix wrong page aligned size calculation in ioremapping code

tip:x86/mm tip-bot for Florian Zumbiehl 1 participant 1 message Jul 21, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Commit-ID:  468c30f2bbdf1ba0fbf16667eade23a46eaa8f06
Gitweb:     http://git.kernel.org/tip/468c30f2bbdf1ba0fbf16667eade23a46eaa8f06
Author:     Florian Zumbiehl <[email protected]>
AuthorDate: Tue, 20 Jul 2010 15:19:47 -0700
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Tue, 20 Jul 2010 16:56:35 -0700

x86, iomap: Fix wrong page aligned size calculation in ioremapping code

x86 early_iounmap(): fix off-by-one error in page alignment of allocation size for sizes where size%PAGE_SIZE==1.

LKML-Reference: <[email protected]>

---
 arch/x86/mm/ioremap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/mm/ioremap.c +1 -1
index d41d3a9..3ba6e06 100644
@@ -611,7 +611,7 @@ void __init early_iounmap(void __iomem *addr, unsigned long size)
 		return;
 	}
 	offset = virt_addr & ~PAGE_MASK;
-	nrpages = PAGE_ALIGN(offset + size - 1) >> PAGE_SHIFT;
+	nrpages = PAGE_ALIGN(offset + size) >> PAGE_SHIFT;
 
 	idx = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*slot;
 	while (nrpages > 0) {