summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_socket2.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-07-18 06:12:10 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-07-18 06:12:10 +0000
commitf1aedce45e5646b5a858a34522726d4028cadfb3 (patch)
treebf15e78f61d4eda45f6a670d458c93c2bdc38728 /sys/kern/uipc_socket2.c
parent36ea9a4f6364d42f9553f0905371e9055ad0f0c8 (diff)
soreserve() modifies `so_snd' and `so_rcv' so asserts that it is called
with the socket lock. This change is safe because sbreserve() already asserts that the lock is held, but it acts as implicit documentation and indicates that I looked at the function.
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r--sys/kern/uipc_socket2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index 27e47adf8ed..7935e847754 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket2.c,v 1.83 2017/07/04 12:58:32 mpi Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.84 2017/07/18 06:12:09 mpi Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
@@ -429,6 +429,7 @@ sowakeup(struct socket *so, struct sockbuf *sb)
int
soreserve(struct socket *so, u_long sndcc, u_long rcvcc)
{
+ soassertlocked(so);
if (sbreserve(so, &so->so_snd, sndcc))
goto bad;