diff options
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r-- | arch/x86/kernel/e820.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 3f7777b255aa..91abf5b2fb94 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -143,7 +143,7 @@ void __init e820_print_map(char *who) | |||
143 | * | 143 | * |
144 | */ | 144 | */ |
145 | int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, | 145 | int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, |
146 | char *pnr_map) | 146 | int *pnr_map) |
147 | { | 147 | { |
148 | struct change_member { | 148 | struct change_member { |
149 | struct e820entry *pbios; /* pointer to original bios entry */ | 149 | struct e820entry *pbios; /* pointer to original bios entry */ |
@@ -204,6 +204,7 @@ static struct e820entry new_bios[E820_X_MAX] __initdata; | |||
204 | return -1; | 204 | return -1; |
205 | 205 | ||
206 | old_nr = *pnr_map; | 206 | old_nr = *pnr_map; |
207 | BUG_ON(old_nr > max_nr_map); | ||
207 | 208 | ||
208 | /* bail out if we find any unreasonable addresses in bios map */ | 209 | /* bail out if we find any unreasonable addresses in bios map */ |
209 | for (i = 0; i < old_nr; i++) | 210 | for (i = 0; i < old_nr; i++) |
@@ -401,7 +402,7 @@ u64 __init update_memory_range(u64 start, u64 size, unsigned old_type, | |||
401 | 402 | ||
402 | void __init update_e820(void) | 403 | void __init update_e820(void) |
403 | { | 404 | { |
404 | u8 nr_map; | 405 | int nr_map; |
405 | 406 | ||
406 | nr_map = e820.nr_map; | 407 | nr_map = e820.nr_map; |
407 | if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr_map)) | 408 | if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr_map)) |