diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-06-03 14:26:04 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-07-12 06:13:33 -0400 |
commit | 6d78b5f9c6cf59c98d3833e09d0ed6aebd6a33d3 (patch) | |
tree | ad95d89fa69f6aa452040cef60438d08e5748a46 /arch/arm | |
parent | 4486b86368d72bcac76439638b36667b1c6a1360 (diff) |
[ARM] Fix bounding error in ioremap_pfn()
If size=16M offset=2K then we should map two supersections
rather than just one.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mm/ioremap.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index f3ade18862aa..75952779ce19 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c | |||
@@ -280,7 +280,10 @@ __arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size, | |||
280 | if (!type) | 280 | if (!type) |
281 | return NULL; | 281 | return NULL; |
282 | 282 | ||
283 | size = PAGE_ALIGN(size); | 283 | /* |
284 | * Page align the mapping size, taking account of any offset. | ||
285 | */ | ||
286 | size = PAGE_ALIGN(offset + size); | ||
284 | 287 | ||
285 | area = get_vm_area(size, VM_IOREMAP); | 288 | area = get_vm_area(size, VM_IOREMAP); |
286 | if (!area) | 289 | if (!area) |
@@ -325,11 +328,6 @@ __arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype) | |||
325 | if (!size || last_addr < phys_addr) | 328 | if (!size || last_addr < phys_addr) |
326 | return NULL; | 329 | return NULL; |
327 | 330 | ||
328 | /* | ||
329 | * Page align the mapping size | ||
330 | */ | ||
331 | size = PAGE_ALIGN(last_addr + 1) - phys_addr; | ||
332 | |||
333 | return __arm_ioremap_pfn(pfn, offset, size, mtype); | 331 | return __arm_ioremap_pfn(pfn, offset, size, mtype); |
334 | } | 332 | } |
335 | EXPORT_SYMBOL(__arm_ioremap); | 333 | EXPORT_SYMBOL(__arm_ioremap); |