diff options
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r-- | arch/x86/kernel/e820.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 15b4393ff9bf..1b76b25b4d9a 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -405,6 +405,9 @@ u64 __init e820_update_range(u64 start, u64 size, unsigned old_type, | |||
405 | 405 | ||
406 | BUG_ON(old_type == new_type); | 406 | BUG_ON(old_type == new_type); |
407 | 407 | ||
408 | if (size > (ULLONG_MAX - start)) | ||
409 | size = ULLONG_MAX - start; | ||
410 | |||
408 | for (i = 0; i < e820.nr_map; i++) { | 411 | for (i = 0; i < e820.nr_map; i++) { |
409 | struct e820entry *ei = &e820.map[i]; | 412 | struct e820entry *ei = &e820.map[i]; |
410 | u64 final_start, final_end; | 413 | u64 final_start, final_end; |
@@ -441,6 +444,9 @@ u64 __init e820_remove_range(u64 start, u64 size, unsigned old_type, | |||
441 | int i; | 444 | int i; |
442 | u64 real_removed_size = 0; | 445 | u64 real_removed_size = 0; |
443 | 446 | ||
447 | if (size > (ULLONG_MAX - start)) | ||
448 | size = ULLONG_MAX - start; | ||
449 | |||
444 | for (i = 0; i < e820.nr_map; i++) { | 450 | for (i = 0; i < e820.nr_map; i++) { |
445 | struct e820entry *ei = &e820.map[i]; | 451 | struct e820entry *ei = &e820.map[i]; |
446 | u64 final_start, final_end; | 452 | u64 final_start, final_end; |