diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 030ca5b17911..8b0bc25328d5 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -949,6 +949,7 @@ soreceive(so, psa, uio, mp0, controlp, flagsp) so->so_error = 0; goto release; } + SOCKBUF_LOCK_ASSERT(&so->so_rcv); if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { if (m) goto dontblock; @@ -1115,6 +1116,7 @@ soreceive(so, psa, uio, mp0, controlp, flagsp) goto release; } else uio->uio_resid -= len; + SOCKBUF_LOCK_ASSERT(&so->so_rcv); if (len == m->m_len - moff) { if (m->m_flags & M_EOR) flags |= MSG_EOR; @@ -1158,6 +1160,7 @@ soreceive(so, psa, uio, mp0, controlp, flagsp) so->so_rcv.sb_cc -= len; } } + SOCKBUF_LOCK_ASSERT(&so->so_rcv); if (so->so_oobmark) { if ((flags & MSG_PEEK) == 0) { so->so_oobmark -= len; @@ -1206,6 +1209,7 @@ soreceive(so, psa, uio, mp0, controlp, flagsp) } } + SOCKBUF_LOCK_ASSERT(&so->so_rcv); if (m != NULL && pr->pr_flags & PR_ATOMIC) { flags |= MSG_TRUNC; if ((flags & MSG_PEEK) == 0) { @@ -1248,6 +1252,7 @@ soreceive(so, psa, uio, mp0, controlp, flagsp) SOCKBUF_LOCK_ASSERT(&so->so_rcv); sbunlock(&so->so_rcv); out: + SOCKBUF_LOCK_ASSERT(&so->so_rcv); SOCKBUF_UNLOCK(&so->so_rcv); return (error); }