From 9e2f8a9afdfcf3462b4a357d105b822bc03031b6 Mon Sep 17 00:00:00 2001 From: nwhitehorn Date: Tue, 28 Nov 2017 05:39:48 +0000 Subject: [PATCH] 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@ --- sys/kern/subr_pcpu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/kern/subr_pcpu.c b/sys/kern/subr_pcpu.c index 06e5d18b3302..438c300287f3 100644 --- a/sys/kern/subr_pcpu.c +++ b/sys/kern/subr_pcpu.c @@ -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]); }