浏览代码

ARM: 8544/1: set_memory_xx fixes

Allow zero size updates. This makes set_memory_xx() consistent with x86, s390 and arm64 and makes apply_to_page_range() not to BUG() when loading modules.

Signed-off-by: Mika Penttilä mika.penttila@nextfour.com
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Mika Penttilä 9 年之前
父节点
当前提交
f474c8c857
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      arch/arm/mm/pageattr.c

+ 3 - 0
arch/arm/mm/pageattr.c

@@ -49,6 +49,9 @@ static int change_memory_common(unsigned long addr, int numpages,
 		WARN_ON_ONCE(1);
 	}
 
+	if (!numpages)
+		return 0;
+
 	if (start < MODULES_VADDR || start >= MODULES_END)
 		return -EINVAL;