summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2015-11-08 23:23:13 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2015-11-08 23:23:13 +0000
commitf74ad1bacd6473b3278e6cdbd2a28a336184832f (patch)
tree326e3b77ef590fc3a9c66f11100c5844ab60ac5e
parent0d18bf8a437a97b6ac0f7fe60ffac0dd1007ad3e (diff)
pull initialization up before poosible goto bad, from Mark Latimer
-rw-r--r--sys/kern/uipc_syscalls.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 9ba2926f304..e2866a1a363 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_syscalls.c,v 1.123 2015/11/01 19:03:33 semarie Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.124 2015/11/08 23:23:12 tedu Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
@@ -240,13 +240,15 @@ doaccept(struct proc *p, int sock, struct sockaddr *name, socklen_t *anamelen,
return (error);
if ((error = getsock(p, sock, &fp)) != 0)
return (error);
+
+ s = splsoftnet();
+ headfp = fp;
+ head = fp->f_data;
+
if (isdnssocket((struct socket *)fp->f_data)) {
error = EINVAL;
goto bad;
}
- headfp = fp;
- s = splsoftnet();
- head = fp->f_data;
redo:
if ((head->so_options & SO_ACCEPTCONN) == 0) {
error = EINVAL;