From: Russell King Date: Sun, 17 Dec 2006 23:29:57 +0000 (+0000) Subject: [ARM] Fix BUG()s in ioremap() code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c924aff853bdc1c9841dd22440f931fba5ab3a59;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [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: Russell King --- diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index 3bb3951920bc..251685fe73a8 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c @@ -292,6 +292,8 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size, if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK)) return NULL; + size = PAGE_ALIGN(size); + area = get_vm_area(size, VM_IOREMAP); if (!area) return NULL;