Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Nov 2019 22:40:19 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354416 - head/sys/kern
Message-ID:  <201911062240.xA6MeJL6059081@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



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