Commit 636e645f authored by Vladimir Murzin's avatar Vladimir Murzin Committed by Russell King

ARM: 8740/1: NOMMU: Make sure we do not hold stale data in mem[] array

adjust_lowmem_bounds() called twice which can lead to stalled data
(i.e. subreg) value in mem[] array after the first call.

Zero out mem[] array before we allocate MPU regions for memory.

Fixes: 5c9d9a1b ("ARM: 8712/1: NOMMU: Use more MPU regions to cover memory")
Signed-off-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent 62d1c95d
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/memblock.h> #include <linux/memblock.h>
#include <linux/string.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/cp15.h> #include <asm/cp15.h>
...@@ -296,6 +297,7 @@ void __init adjust_lowmem_bounds_mpu(void) ...@@ -296,6 +297,7 @@ void __init adjust_lowmem_bounds_mpu(void)
} }
} }
memset(mem, 0, sizeof(mem));
num = allocate_region(mem_start, specified_mem_size, mem_max_regions, mem); num = allocate_region(mem_start, specified_mem_size, mem_max_regions, mem);
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
......
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