Commit 6d78b5f9 authored by Russell King's avatar Russell King Committed by Russell King

[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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 4486b863
...@@ -280,7 +280,10 @@ __arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size, ...@@ -280,7 +280,10 @@ __arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
if (!type) if (!type)
return NULL; return NULL;
size = PAGE_ALIGN(size); /*
* Page align the mapping size, taking account of any offset.
*/
size = PAGE_ALIGN(offset + size);
area = get_vm_area(size, VM_IOREMAP); area = get_vm_area(size, VM_IOREMAP);
if (!area) if (!area)
...@@ -325,11 +328,6 @@ __arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype) ...@@ -325,11 +328,6 @@ __arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
if (!size || last_addr < phys_addr) if (!size || last_addr < phys_addr)
return NULL; return NULL;
/*
* Page align the mapping size
*/
size = PAGE_ALIGN(last_addr + 1) - phys_addr;
return __arm_ioremap_pfn(pfn, offset, size, mtype); return __arm_ioremap_pfn(pfn, offset, size, mtype);
} }
EXPORT_SYMBOL(__arm_ioremap); EXPORT_SYMBOL(__arm_ioremap);
......
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