summaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/numa_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/numa_64.c')
-rw-r--r--arch/x86/mm/numa_64.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 7757d2214fab..541746fdeb4b 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -390,14 +390,12 @@ static void __init numa_nodemask_from_meminfo(nodemask_t *nodemask,
*/
void __init numa_reset_distance(void)
{
- size_t size;
+ size_t size = numa_distance_cnt * numa_distance_cnt * sizeof(numa_distance[0]);
- if (numa_distance_cnt) {
- size = numa_distance_cnt * sizeof(numa_distance[0]);
+ if (numa_distance_cnt)
memblock_x86_free_range(__pa(numa_distance),
__pa(numa_distance) + size);
- numa_distance_cnt = 0;
- }
+ numa_distance_cnt = 0;
numa_distance = NULL;
}