aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2023-08-13 20:47:43 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2024-01-11 12:40:56 +0000
commitecfe48f28a40700f4950c2e5bd21ebc49b942bf4 (patch)
treef1a05c2d1f18dbbe648996e97584d051d06400a8
parentc9e9bfc22e6da6969bbb39920a7090a31ee988b5 (diff)
downloadsrc-ecfe48f28a40700f4950c2e5bd21ebc49b942bf4.tar.gz
src-ecfe48f28a40700f4950c2e5bd21ebc49b942bf4.zip
sctp: add an assert
This enforces a condition mentioned in a comment. (cherry picked from commit e8eb0b713426fe9edbf56719351850fa9469286a)
-rw-r--r--sys/netinet/sctputil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index 72edf4dd66c9..e21fbe041291 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -3636,7 +3636,6 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb)
&stcb->sctp_socket->so_rcv, 1, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED);
}
-/* This always must be called with the read-queue LOCKED in the INP */
static void
sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error,
uint32_t val, int so_locked)
@@ -3652,6 +3651,8 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error,
return;
}
+ SCTP_INP_READ_LOCK_ASSERT(stcb->sctp_ep);
+
m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, M_NOWAIT, 1, MT_DATA);
if (m_notify == NULL)
/* no space left */