diff options
author | 2017-08-10 19:20:43 +0000 | |
---|---|---|
committer | 2017-08-10 19:20:43 +0000 | |
commit | 2b549d884cb2fac3bf3fc05ccf2ece5b6fea4241 (patch) | |
tree | 3d7de47fc3e62bc26f793cb12bdf1356eb7c29d2 /sys/kern/uipc_socket.c | |
parent | Make rw_enter() always succeed after a panic. (diff) | |
download | wireguard-openbsd-2b549d884cb2fac3bf3fc05ccf2ece5b6fea4241.tar.xz wireguard-openbsd-2b549d884cb2fac3bf3fc05ccf2ece5b6fea4241.zip |
Move the solock()/sounlock() dance outside of sobind().
ok phessler@, visa@, bluhm@
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r-- | sys/kern/uipc_socket.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 6dafd3e38e5..c499f46de04 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.200 2017/08/10 16:48:25 bluhm Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.201 2017/08/10 19:20:43 mpi Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -152,11 +152,11 @@ socreate(int dom, struct socket **aso, int type, int proto) int sobind(struct socket *so, struct mbuf *nam, struct proc *p) { - int s, error; + int error; + + soassertlocked(so); - s = solock(so); error = (*so->so_proto->pr_usrreq)(so, PRU_BIND, NULL, nam, NULL, p); - sounlock(s); return (error); } |