This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new afea2d80de4 net/tcp: Unlock the listener once in
tcp_accept_connection().
afea2d80de4 is described below
commit afea2d80de4068eaa388ff0349fc8da408fe51c4
Author: raiden00pl <[email protected]>
AuthorDate: Tue Nov 17 13:10:46 2026 +0100
net/tcp: Unlock the listener once in tcp_accept_connection().
The backlog path unlocked listener->sconn after tcp_backlogadd() and
again after tcp_callback(), so every backlogged connection released
the lock twice and hit the rmutex count assertion. Keep the lock
held across tcp_callback() and unlock it once.
Assisted-by: Claude:claude-opus-5-5
Claude-Session: https://claude.ai/code/session_016jHJhPAPLtehSyWt5GWZnj
Signed-off-by: raiden00pl <[email protected]>
---
net/tcp/tcp_listen.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/tcp/tcp_listen.c b/net/tcp/tcp_listen.c
index 3c200725ec3..2a419e5b6fd 100644
--- a/net/tcp/tcp_listen.c
+++ b/net/tcp/tcp_listen.c
@@ -274,7 +274,6 @@ int tcp_accept_connection(FAR struct net_driver_s *dev,
conn_lock(&listener->sconn);
ret = tcp_backlogadd(listener, conn);
- conn_unlock(&listener->sconn);
if (ret == OK)
{
tcp_callback(dev, listener, TCP_BACKLOG);