From b5bb0d56ad2b3e90d48ba894cd340dfd84aed0bf Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 20 Jul 2021 15:52:09 +0900 Subject: [PATCH] tcp: fix an assertion in "fix iob allocation deadlock" commit Fix a wrong assertion in: ``` commit 98ec46d726b4b58e58f8fc149a38628d7dde193e Author: YAMAMOTO Takashi Date: Tue Jul 20 09:10:43 2021 +0900 tcp_send_buffered.c: fix iob allocation deadlock Ensure to put the wrb back onto the write_q when blocking on iob allocation. Otherwise, it can deadlock with other threads doing the same thing. ``` I forget to submit this with https://github.com/apache/incubator-nuttx/pull/4257 --- net/tcp/tcp_send_buffered.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index 10000976f3e..ea3e9758e85 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -1163,7 +1163,7 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR const void *buf, { wrb = tcp_wrbuffer_tryalloc(); ninfo("new wrb %p (non blocking)\n", wrb); - DEBUGASSERT(TCP_WBPKTLEN(wrb) == 0); + DEBUGASSERT(wrb == NULL || TCP_WBPKTLEN(wrb) == 0); } else {