aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/check.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/check.c')
-rw-r--r--arch/x86/kernel/check.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/check.c b/arch/x86/kernel/check.c
index b617b1164f1..fc999e6fc46 100644
--- a/arch/x86/kernel/check.c
+++ b/arch/x86/kernel/check.c
@@ -86,12 +86,12 @@ void __init setup_bios_corruption_check(void)
if (!(addr + 1))
break;
+ if (addr >= corruption_check_size)
+ break;
+
if ((addr + size) > corruption_check_size)
size = corruption_check_size - addr;
- if (size == 0)
- break;
-
e820_update_range(addr, size, E820_RAM, E820_RESERVED);
scan_areas[num_scan_areas].addr = addr;
scan_areas[num_scan_areas].size = size;