Remove assertion that a CPU be present before returning a PCPU for it. It

is up to the caller to check for a NULL return value. The assert was meant
to catch buggy code that did not check the return value. Some code, however,
was smart and used the return value to see if a CPU existed, which this
broke.

Requested by:	jhb@
This commit is contained in:
Nathan Whitehorn 2017-11-28 05:39:48 +00:00
parent ff88ef4183
commit 51de47e3f8

View File

@ -279,8 +279,6 @@ pcpu_destroy(struct pcpu *pcpu)
struct pcpu *
pcpu_find(u_int cpuid)
{
KASSERT(cpuid_to_pcpu[cpuid] != NULL,
("Getting uninitialized PCPU %d", cpuid));
return (cpuid_to_pcpu[cpuid]);
}