diff options
-rw-r--r-- | arch/x86/xen/setup.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index ff3dfa17681..09688eb4a89 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
@@ -305,10 +305,12 @@ char * __init xen_memory_setup(void) | |||
305 | sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); | 305 | sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); |
306 | 306 | ||
307 | extra_limit = xen_get_max_pages(); | 307 | extra_limit = xen_get_max_pages(); |
308 | if (extra_limit >= max_pfn) | 308 | if (max_pfn + extra_pages > extra_limit) { |
309 | extra_pages = extra_limit - max_pfn; | 309 | if (extra_limit > max_pfn) |
310 | else | 310 | extra_pages = extra_limit - max_pfn; |
311 | extra_pages = 0; | 311 | else |
312 | extra_pages = 0; | ||
313 | } | ||
312 | 314 | ||
313 | extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820); | 315 | extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820); |
314 | 316 | ||