summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2017-11-02 14:01:18 +0000
committerflorian <florian@openbsd.org>2017-11-02 14:01:18 +0000
commit2c5f89aa3af53cc28e3d36f3b88d081fdaa44cd6 (patch)
treec0892e6bfb20622cb3cc7c002ada827897782f83 /sys/kern/uipc_socket.c
parentCheck if the arguments are NULL instead of dereferencing them blindly. (diff)
downloadwireguard-openbsd-2c5f89aa3af53cc28e3d36f3b88d081fdaa44cd6.tar.xz
wireguard-openbsd-2c5f89aa3af53cc28e3d36f3b88d081fdaa44cd6.zip
Move PRU_DETACH out of pr_usrreq into per proto pr_detach
functions to pave way for more fine grained locking. Suggested by, comments & OK mpi
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 615da029414..ce240b62fe6 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.205 2017/09/15 19:29:28 bluhm Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.206 2017/11/02 14:01:18 florian Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -266,8 +266,9 @@ soclose(struct socket *so)
}
drop:
if (so->so_pcb) {
- int error2 = (*so->so_proto->pr_usrreq)(so, PRU_DETACH, NULL,
- NULL, NULL, curproc);
+ int error2;
+ KASSERT(so->so_proto->pr_detach);
+ error2 = (*so->so_proto->pr_detach)(so);
if (error == 0)
error = error2;
}