提交 2ca230ba 编写于 作者: Y Yinghai Lu 提交者: Tejun Heo

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: NYinghai Lu <yinghai@kernel.org>
Signed-off-by: NTejun Heo <tj@kernel.org>
Reported-by: NIngo Molnar <mingo@elte.hu>
上级 e23bba60
......@@ -371,11 +371,13 @@ static void __init numa_reset_distance(void)
{
size_t size;
if (numa_distance_cnt) {
size = numa_distance_cnt * sizeof(numa_distance[0]);
memblock_x86_free_range(__pa(numa_distance),
__pa(numa_distance) + size);
numa_distance = NULL;
numa_distance_cnt = 0;
}
numa_distance = NULL;
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册