From 7669173fe540ee67c2bfb2d2f03bf64ee49a2fef Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Tue, 14 Nov 2006 16:57:46 +0100 Subject: [PATCH] --- yaml --- r: 40923 b: refs/heads/master c: 5e58a02a8f6a7a1c9ae41f39286bcd3aea0d6f24 h: refs/heads/master i: 40921: 6e4a5ad1245c765e02037662162de1eb9a6d006a 40919: 9e7e1f6e56c60815fbe0211665dae94069b1a0ed v: v3 --- [refs] | 2 +- trunk/arch/x86_64/mm/init.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 5178ff0c8c1e..5ed273eb1726 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 51d67a488b53a5cc8401460480c124eaec71e2d4 +refs/heads/master: 5e58a02a8f6a7a1c9ae41f39286bcd3aea0d6f24 diff --git a/trunk/arch/x86_64/mm/init.c b/trunk/arch/x86_64/mm/init.c index 971dc1181e69..f1f977aafae1 100644 --- a/trunk/arch/x86_64/mm/init.c +++ b/trunk/arch/x86_64/mm/init.c @@ -655,9 +655,22 @@ void free_initrd_mem(unsigned long start, unsigned long end) void __init reserve_bootmem_generic(unsigned long phys, unsigned len) { - /* Should check here against the e820 map to avoid double free */ #ifdef CONFIG_NUMA int nid = phys_to_nid(phys); +#endif + unsigned long pfn = phys >> PAGE_SHIFT; + if (pfn >= end_pfn) { + /* This can happen with kdump kernels when accessing firmware + tables. */ + if (pfn < end_pfn_map) + return; + printk(KERN_ERR "reserve_bootmem: illegal reserve %lx %u\n", + phys, len); + return; + } + + /* Should check here against the e820 map to avoid double free */ +#ifdef CONFIG_NUMA reserve_bootmem_node(NODE_DATA(nid), phys, len); #else reserve_bootmem(phys, len);