Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ca230ba authored by Yinghai Lu's avatar Yinghai Lu Committed by Tejun Heo
Browse files

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: default avatarYinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Reported-by: default avatarIngo Molnar <mingo@elte.hu>
parent e23bba60
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -371,12 +371,14 @@ static void __init numa_reset_distance(void)
{
{
	size_t size;
	size_t size;


	if (numa_distance_cnt) {
		size = numa_distance_cnt * sizeof(numa_distance[0]);
		size = numa_distance_cnt * sizeof(numa_distance[0]);
		memblock_x86_free_range(__pa(numa_distance),
		memblock_x86_free_range(__pa(numa_distance),
					__pa(numa_distance) + size);
					__pa(numa_distance) + size);
	numa_distance = NULL;
		numa_distance_cnt = 0;
		numa_distance_cnt = 0;
	}
	}
	numa_distance = NULL;
}


/*
/*
 * Set the distance between node @from to @to to @distance.  If distance
 * Set the distance between node @from to @to to @distance.  If distance