From: Thomas Bogendoerfer Date: Tue, 8 Jan 2008 23:33:11 +0000 (-0800) Subject: Fix crash with FLAT_MEMORY and ARCH_PFN_OFFSET != 0 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=467bc461d2845f6a04b124bca1ae6ecc554e1ee5;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git Fix crash with FLAT_MEMORY and ARCH_PFN_OFFSET != 0 When using FLAT_MEMORY and ARCH_PFN_OFFSET is not 0, the kernel crashes in memmap_init_zone(). This bug got introduced by commit c713216deebd95d2b0ab38fef8bb2361c0180c2d Signed-off-by: Thomas Bogendoerfer Acked-by: Mel Gorman Cc: Bob Picco Cc: Dave Hansen Cc: Andy Whitcroft Cc: Andi Kleen Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: "Keith Mannthey" Cc: "Luck, Tony" Cc: KAMEZAWA Hiroyuki Cc: Yasunori Goto Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index d73bfad1c32..e1028fae3eb 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3438,7 +3438,7 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat) mem_map = NODE_DATA(0)->node_mem_map; #ifdef CONFIG_ARCH_POPULATES_NODE_MAP if (page_to_pfn(mem_map) != pgdat->node_start_pfn) - mem_map -= pgdat->node_start_pfn; + mem_map -= (pgdat->node_start_pfn - ARCH_PFN_OFFSET); #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ } #endif