summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-07-15 22:16:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-07-15 22:16:43 +0000
commit5e8589374c930031aaf4735e952691c378a260b8 (patch)
tree158957edef63bb7cac587a2b4370754b04559bae /sys/netinet/tcp_usrreq.c
parenta763f70dd81e802e555963fb255d7538e879b607 (diff)
m_freem() can handle NULL, do not check for this condition beforehands.
ok stsp mpi
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r--sys/netinet/tcp_usrreq.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 8418b99a3df..e2464dc5717 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.125 2015/06/07 12:02:28 jsg Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.126 2015/07/15 22:16:42 deraadt Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -149,8 +149,7 @@ tcp_usrreq(so, req, m, nam, control, p)
}
if (control && control->m_len) {
m_freem(control);
- if (m)
- m_freem(m);
+ m_freem(m);
return (EINVAL);
}
@@ -170,7 +169,7 @@ tcp_usrreq(so, req, m, nam, control, p)
* The following corrects an mbuf leak under rare
* circumstances
*/
- if (m && (req == PRU_SEND || req == PRU_SENDOOB))
+ if (req == PRU_SEND || req == PRU_SENDOOB)
m_freem(m);
return (error);
}
@@ -485,7 +484,7 @@ tcp_ctloutput(op, so, level, optname, mp)
inp = sotoinpcb(so);
if (inp == NULL) {
splx(s);
- if (op == PRCO_SETOPT && *mp)
+ if (op == PRCO_SETOPT)
(void) m_free(*mp);
return (ECONNRESET);
}