diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c --- a/sys/arm64/arm64/mp_machdep.c +++ b/sys/arm64/arm64/mp_machdep.c @@ -147,7 +147,7 @@ static volatile int aps_ready; /* Temporary variables for init_secondary() */ -static void *dpcpu[MAXCPU - 1]; +static void **dpcpu; static bool is_boot_cpu(uint64_t target_cpu) @@ -320,6 +320,7 @@ kmem_free(bootstacks[cpu - 1], MP_BOOTSTACK_SIZE); } kmem_free(bootstacks, mp_maxid * sizeof(*bootstacks)); + kmem_free(dpcpu, mp_maxid * sizeof(*dpcpu)); } SYSINIT(smp_after_idle_runnable, SI_SUB_SMP, SI_ORDER_ANY, smp_after_idle_runnable, NULL); @@ -781,6 +782,7 @@ * we need an array suze of mp_maxid. */ bootstacks = kmem_malloc(mp_maxid * sizeof(*bootstacks), M_WAITOK); + dpcpu = kmem_malloc(mp_maxid * sizeof(*dpcpu), M_WAITOK); /* CPU 0 is always boot CPU. */ CPU_SET(0, &all_cpus);