From: mvs Date: Sun, 11 Feb 2024 21:36:49 +0000 (+0000) Subject: Release `sb_mtx' mutex(9) before sbunlock(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1a2f6adc80ba574c4707221d706ee10827fe27a8;p=openbsd Release `sb_mtx' mutex(9) before sbunlock(). ok bluhm --- diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 9a2bda2aa14..6d7422c798a 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.318 2024/02/11 18:14:26 mvs Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.319 2024/02/11 21:36:49 mvs Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -900,8 +900,8 @@ restart: } SBLASTRECORDCHK(&so->so_rcv, "soreceive sbwait 1"); SBLASTMBUFCHK(&so->so_rcv, "soreceive sbwait 1"); - sbunlock(so, &so->so_rcv); sb_mtx_unlock(&so->so_rcv); + sbunlock(so, &so->so_rcv); error = sbwait(so, &so->so_rcv); if (error) { sounlock_shared(so); @@ -1179,8 +1179,8 @@ dontblock: if (orig_resid == uio->uio_resid && orig_resid && (flags & MSG_EOR) == 0 && (so->so_rcv.sb_state & SS_CANTRCVMORE) == 0) { - sbunlock(so, &so->so_rcv); sb_mtx_unlock(&so->so_rcv); + sbunlock(so, &so->so_rcv); goto restart; } @@ -1190,8 +1190,8 @@ dontblock: if (flagsp) *flagsp |= flags; release: - sbunlock(so, &so->so_rcv); sb_mtx_unlock(&so->so_rcv); + sbunlock(so, &so->so_rcv); sounlock_shared(so); return (error); }