summaryrefslogtreecommitdiff
path: root/mm/memtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memtest.c')
-rw-r--r--mm/memtest.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/memtest.c b/mm/memtest.c
index c2c609c39119..520d41534cfa 100644
--- a/mm/memtest.c
+++ b/mm/memtest.c
@@ -50,6 +50,8 @@ static void __init memtest(u64 pattern, phys_addr_t start_phys, phys_addr_t size
start_bad = 0;
last_bad = 0;
+ VM_WARN_ON_ONCE(size < start_phys_aligned - start_phys);
+
for (p = start; p < end; p++)
WRITE_ONCE(*p, pattern);