svn commit: r326308 - head/sys/kern
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Tue Nov 28 05:39:50 UTC 2017
Author: nwhitehorn
Date: Tue Nov 28 05:39:48 2017
New Revision: 326308
URL: https://svnweb.freebsd.org/changeset/base/326308
Log:
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@
Modified:
head/sys/kern/subr_pcpu.c
Modified: head/sys/kern/subr_pcpu.c
==============================================================================
--- head/sys/kern/subr_pcpu.c Tue Nov 28 01:35:28 2017 (r326307)
+++ head/sys/kern/subr_pcpu.c Tue Nov 28 05:39:48 2017 (r326308)
@@ -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]);
}
More information about the svn-src-all
mailing list