瀏覽代碼

[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 <rmk+kernel@arm.linux.org.uk>
Russell King 18 年之前
父節點
當前提交
c924aff853
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      arch/arm/mm/ioremap.c

+ 2 - 0
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;