lkml.org 
[lkml]   [2010]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] __ioremap_caller(): make check for ioremapping of RAM cover complete mapping
Hi,

the patch is untested and someone with detailed understanding of the
semantics of this code probably should check for correctness of
the fixed version in corner cases.

Florian
---------------------------------------------------------------------------
x86 __ioremap_caller(): fix check for overlap with RAM to check the
last page of the mapping as well.

Signed-off-by: Florian Zumbiehl <florz@florz.de>

diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index a4643e5..4c3e4f9 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -101,7 +101,7 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr,
* Don't allow anybody to remap normal RAM that we're using..
*/
for (pfn = phys_addr >> PAGE_SHIFT;
- (pfn << PAGE_SHIFT) < (last_addr & PAGE_MASK);
+ pfn <= (last_addr >> PAGE_SHIFT);
pfn++) {

int is_ram = page_is_ram(pfn);

\
 
 \ /
  Last update: 2010-06-15 19:13    [W:0.029 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site