svn commit: r354416 - head/sys/kern

Bjoern A. Zeeb bz at FreeBSD.org
Wed Nov 6 22:40:20 UTC 2019


Author: bz
Date: Wed Nov  6 22:40:19 2019
New Revision: 354416
URL: https://svnweb.freebsd.org/changeset/base/354416

Log:
  m_pulldown(): Change an if () panic() into a KASSERT().
  
  If we pass in a NULL mbuf to m_pulldown() we are in a bad situation
  already.  There is no point in doing that check for production code.
  Change the if () panic() into a KASSERT.
  
  MFC after:	3 weeks
  Sponsored by:	Netflix

Modified:
  head/sys/kern/uipc_mbuf2.c

Modified: head/sys/kern/uipc_mbuf2.c
==============================================================================
--- head/sys/kern/uipc_mbuf2.c	Wed Nov  6 21:13:10 2019	(r354415)
+++ head/sys/kern/uipc_mbuf2.c	Wed Nov  6 22:40:19 2019	(r354416)
@@ -101,8 +101,8 @@ m_pulldown(struct mbuf *m, int off, int len, int *offp
 	int writable;
 
 	/* check invalid arguments. */
-	if (m == NULL)
-		panic("m == NULL in m_pulldown()");
+	KASSERT(m != NULL, ("%s: fix caller: m is NULL off %d len %d offp %p\n",
+	    __func__, off, len, offp));
 	if (len > MCLBYTES) {
 		m_freem(m);
 		return NULL;	/* impossible */


More information about the svn-src-head mailing list