mirror of
https://github.com/opnsense/src.git
synced 2026-04-15 14:29:58 -04:00
initialize mp_ncpus in cpu_mp_probe() so that if the probe fails and
cpu_mp_start() is never called, mp_ncpus will have a non-zero value. This prevents systat from dying with an arithmatic exception caused by a divide-by-zero error on UP alphas running a GENERIC kernel.
This commit is contained in:
parent
607dba5ff6
commit
a7f595f8a2
1 changed files with 2 additions and 2 deletions
|
|
@ -301,6 +301,8 @@ cpu_mp_probe(void)
|
|||
|
||||
/* XXX: Need to check for valid platforms here. */
|
||||
|
||||
mp_ncpus = 1;
|
||||
|
||||
/* Make sure we have at least one secondary CPU. */
|
||||
cpus = 0;
|
||||
for (i = 0; i < hwrpb->rpb_pcs_cnt; i++) {
|
||||
|
|
@ -328,8 +330,6 @@ cpu_mp_start()
|
|||
|
||||
mtx_init(&ap_boot_mtx, "ap boot", MTX_SPIN);
|
||||
|
||||
mp_ncpus = 1;
|
||||
|
||||
boot_cpu_id = PCPU_GET(cpuid);
|
||||
KASSERT(boot_cpu_id == hwrpb->rpb_primary_cpu_id,
|
||||
("mp_start() called on non-primary CPU"));
|
||||
|
|
|
|||
Loading…
Reference in a new issue