ARM: 8544/1: set_memory_xx fixes
authorMika Penttilä <mika.penttila@nextfour.com>
Mon, 22 Feb 2016 16:56:52 +0000 (17:56 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 4 Mar 2016 23:32:45 +0000 (23:32 +0000)
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>
arch/arm/mm/pageattr.c

index cf30daf..d19b1ad 100644 (file)
@@ -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;