aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2011-02-17 08:46:37 -0500
committerTejun Heo <tj@kernel.org>2011-02-17 09:03:43 -0500
commit2ca230baeb7c61864cab9b53e37a3da28a2ca7e5 (patch)
tree961a13fca73f866363f3da26506eb1c4455d9386 /arch
parente23bba604433a202cd301a976454a90ea6b783ef (diff)
x86-64, NUMA: Don't call __pa() with invalid address in numa_reset_distance()
Do not call __pa(numa_distance) if it was not allocated before. Calling with invalid address triggers VIRTUAL_BUG_ON() in __phys_addr() if CONFIG_DEBUG_VIRTUAL. Also reported by Ingo. http://thread.gmane.org/gmane.linux.kernel/1101306/focus=1101785 - v2: Change to check existing path as tj requested. - tj: Description update. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/mm/numa_64.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 8ce617735900..1bd6de4aa714 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -371,11 +371,13 @@ static void __init numa_reset_distance(void)
371{ 371{
372 size_t size; 372 size_t size;
373 373
374 size = numa_distance_cnt * sizeof(numa_distance[0]); 374 if (numa_distance_cnt) {
375 memblock_x86_free_range(__pa(numa_distance), 375 size = numa_distance_cnt * sizeof(numa_distance[0]);
376 __pa(numa_distance) + size); 376 memblock_x86_free_range(__pa(numa_distance),
377 __pa(numa_distance) + size);
378 numa_distance_cnt = 0;
379 }
377 numa_distance = NULL; 380 numa_distance = NULL;
378 numa_distance_cnt = 0;
379} 381}
380 382
381/* 383/*