Commit 7a998b09 authored by Russell King's avatar Russell King Committed by Catalin Marinas

[ARM] Fix BUG()s in ioremap() code

We need to ensure that the area size is page aligned so that
remap_area_pte() doesn't increment the address past the end of
the desired area.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 27d9101e
...@@ -310,6 +310,8 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size, ...@@ -310,6 +310,8 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK)) if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
return NULL; return NULL;
size = PAGE_ALIGN(size);
area = get_vm_area(size, VM_IOREMAP); area = get_vm_area(size, VM_IOREMAP);
if (!area) if (!area)
return NULL; return NULL;
......
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