summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_syscalls.c
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2010-09-22 04:57:56 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2010-09-22 04:57:56 +0000
commitac30abadbf9b8bccae3d27699d25d595e6eda500 (patch)
tree7a337817c8a2a8f6af75d4f238b495e7763eacf3 /sys/kern/uipc_syscalls.c
parentf50165a4a2043265b68378204fad1bab7d9e9d42 (diff)
Fix a locking bug in accept(2) caught by sthen@ using my strict
locking diff. ok guenther@
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r--sys/kern/uipc_syscalls.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 34ca6b04dcb..08ee5f67778 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_syscalls.c,v 1.77 2010/09/20 07:18:03 deraadt Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.78 2010/09/22 04:57:55 matthew Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
@@ -213,7 +213,7 @@ sys_accept(struct proc *p, void *v, register_t *retval)
*/
soqinsque(head, so, 1);
wakeup_one(&head->so_timeo);
- goto bad;
+ goto unlock;
}
*retval = tmpfd;
@@ -243,8 +243,9 @@ sys_accept(struct proc *p, void *v, register_t *retval)
FILE_SET_MATURE(fp);
}
m_freem(nam);
-bad:
+unlock:
fdpunlock(p->p_fd);
+bad:
splx(s);
FRELE(headfp);
return (error);