Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Mar 2018 18:37:55 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330775 - head/sys/netipsec
Message-ID:  <201803111837.w2BIbt0M018104@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Sun Mar 11 18:37:55 2018
New Revision: 330775
URL: https://svnweb.freebsd.org/changeset/base/330775

Log:
  Replace panic() with KASSERTs.
  
  MFC after:	2 weeks

Modified:
  head/sys/netipsec/keysock.c

Modified: head/sys/netipsec/keysock.c
==============================================================================
--- head/sys/netipsec/keysock.c	Sun Mar 11 18:31:21 2018	(r330774)
+++ head/sys/netipsec/keysock.c	Sun Mar 11 18:37:55 2018	(r330775)
@@ -182,10 +182,9 @@ key_sendup_mbuf(struct socket *so, struct mbuf *m, int
 	struct rawcb *rp;
 	int error = 0;
 
-	if (m == NULL)
-		panic("key_sendup_mbuf: NULL pointer was passed.\n");
-	if (so == NULL && target == KEY_SENDUP_ONE)
-		panic("%s: NULL pointer was passed.\n", __func__);
+	KASSERT(m != NULL, ("NULL mbuf pointer was passed."));
+	KASSERT(so != NULL || target != KEY_SENDUP_ONE,
+	    ("NULL socket pointer was passed."));
 
 	PFKEYSTAT_INC(in_total);
 	PFKEYSTAT_ADD(in_bytes, m->m_pkthdr.len);



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