Replace panic() with KASSERTs.

MFC after:	2 weeks
This commit is contained in:
Andrey V. Elsukov 2018-03-11 18:37:55 +00:00
parent 8355852f85
commit e3004d2429

View File

@ -182,10 +182,9 @@ key_sendup_mbuf(struct socket *so, struct mbuf *m, int target)
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);