summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-12-19 09:29:38 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-12-19 09:29:38 +0000
commitef84c91c3ed8866cfadccc70c9fb5ff1a57db0d5 (patch)
tree8bb263fdd3a609fd742282eac996197e485d229c
parent8fa26800e22453a1bd54fbd3cbfc7bc39eb9953a (diff)
Remove unnecessary unlock/lock dance when following a goto.
ok bluhm@
-rw-r--r--sys/kern/uipc_socket.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 3e4423be70f..64c0c65ca93 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.211 2017/12/18 10:07:55 mpi Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.212 2017/12/19 09:29:37 mpi Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -668,8 +668,8 @@ bad:
if (mp)
*mp = NULL;
-restart:
s = solock(so);
+restart:
if ((error = sblock(so, &so->so_rcv, SBLOCKWAIT(flags))) != 0) {
sounlock(s);
return (error);
@@ -738,9 +738,10 @@ restart:
SBLASTMBUFCHK(&so->so_rcv, "soreceive sbwait 1");
sbunlock(so, &so->so_rcv);
error = sbwait(so, &so->so_rcv);
- sounlock(s);
- if (error)
+ if (error) {
+ sounlock(s);
return (error);
+ }
goto restart;
}
dontblock:
@@ -994,7 +995,6 @@ dontblock:
if (orig_resid == uio->uio_resid && orig_resid &&
(flags & MSG_EOR) == 0 && (so->so_state & SS_CANTRCVMORE) == 0) {
sbunlock(so, &so->so_rcv);
- sounlock(s);
goto restart;
}