[PATCH] x86, numa: exit early on numa_reset_distance()

From: Yinghai Lu
Date: Wed Feb 16 2011 - 15:57:58 EST



Do not call __pa(numa_distance), if it is not allocated before.

it will get BUG_ON if VIRTUAL_DEBUG is on.

Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx>

---
arch/x86/mm/numa_64.c | 6 ++++++
1 file changed, 6 insertions(+)

Index: linux-2.6/arch/x86/mm/numa_64.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/numa_64.c
+++ linux-2.6/arch/x86/mm/numa_64.c
@@ -371,6 +371,12 @@ static void __init numa_reset_distance(v
{
size_t size;

+ if (!numa_distance_cnt) {
+ numa_distance = NULL;
+
+ return;
+ }
+
size = numa_distance_cnt * sizeof(numa_distance[0]);
memblock_x86_free_range(__pa(numa_distance),
__pa(numa_distance) + size);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/