diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c index 6982a320b258..d8b02f18bd3b 100644 --- a/sys/kern/kern_cpu.c +++ b/sys/kern/kern_cpu.c @@ -325,6 +325,12 @@ cf_set_method(device_t dev, const struct cf_level *level, int priority) /* Bind to the target CPU before switching. */ pc = cpu_get_pcpu(set->dev); + + /* Skip settings if CPU is not started. */ + if (pc == NULL) { + error = 0; + goto out; + } thread_lock(curthread); pri = curthread->td_priority; sched_prio(curthread, PRI_MIN);