diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2010-06-17 23:23:57 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-07-09 14:42:11 -0400 |
commit | 35be1b716a475717611b2dc04185e9d80b9cb693 (patch) | |
tree | 6468331fd7f8da58c1bf175af90561edde1eea48 /arch | |
parent | ffa71f33a820d1ab3f2fc5723819ac60fb76080b (diff) |
x86, ioremap: Fix normal ram range check
Check for normal RAM in x86 ioremap() code seems to not work for the
last page frame in the specified physical address range.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
LKML-Reference: <4C1AE6CD.1080704@jp.fujitsu.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/mm/ioremap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 754cb4cbce66..d41d3a9036ca 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, | |||
101 | * Don't allow anybody to remap normal RAM that we're using.. | 101 | * Don't allow anybody to remap normal RAM that we're using.. |
102 | */ | 102 | */ |
103 | last_pfn = last_addr >> PAGE_SHIFT; | 103 | last_pfn = last_addr >> PAGE_SHIFT; |
104 | for (pfn = phys_addr >> PAGE_SHIFT; pfn < last_pfn; pfn++) { | 104 | for (pfn = phys_addr >> PAGE_SHIFT; pfn <= last_pfn; pfn++) { |
105 | int is_ram = page_is_ram(pfn); | 105 | int is_ram = page_is_ram(pfn); |
106 | 106 | ||
107 | if (is_ram && pfn_valid(pfn) && !PageReserved(pfn_to_page(pfn))) | 107 | if (is_ram && pfn_valid(pfn) && !PageReserved(pfn_to_page(pfn))) |