summaryrefslogtreecommitdiffstats
path: root/sys/net/raw_usrreq.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2016-10-08 03:32:25 +0000
committerclaudio <claudio@openbsd.org>2016-10-08 03:32:25 +0000
commitb884f28cc092d20bc201a26df339976661c933f4 (patch)
tree99cc5b763d54b9281fbcc59b120adce217187e07 /sys/net/raw_usrreq.c
parentAdd ktracing of the fds returned by pipe() and socketpair() (diff)
downloadwireguard-openbsd-b884f28cc092d20bc201a26df339976661c933f4.tar.xz
wireguard-openbsd-b884f28cc092d20bc201a26df339976661c933f4.zip
Instead of setting errno and then doing a goto do a m_freem() and return error.
Same thing but nicer to read. OK henning@
Diffstat (limited to 'sys/net/raw_usrreq.c')
-rw-r--r--sys/net/raw_usrreq.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/net/raw_usrreq.c b/sys/net/raw_usrreq.c
index 86288d09968..d17ea931ad0 100644
--- a/sys/net/raw_usrreq.c
+++ b/sys/net/raw_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_usrreq.c,v 1.24 2016/09/05 16:07:01 claudio Exp $ */
+/* $OpenBSD: raw_usrreq.c,v 1.25 2016/10/08 03:32:25 claudio Exp $ */
/* $NetBSD: raw_usrreq.c,v 1.11 1996/02/13 22:00:43 christos Exp $ */
/*
@@ -142,12 +142,12 @@ raw_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
if (req == PRU_CONTROL)
return (EOPNOTSUPP);
if (control && control->m_len) {
- error = EOPNOTSUPP;
- goto release;
+ m_freem(m);
+ return (EOPNOTSUPP);
}
if (rp == 0) {
- error = EINVAL;
- goto release;
+ m_freem(m);
+ return (EINVAL);
}
s = splsoftnet();
switch (req) {
@@ -271,7 +271,6 @@ raw_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
panic("raw_usrreq");
}
splx(s);
-release:
m_freem(m);
return (error);
}