Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 2017 05:39:48 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326308 - head/sys/kern
Message-ID:  <201711280539.vAS5dm2a087507@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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]);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711280539.vAS5dm2a087507>