net/bluetooth: fix rmutex deadlock

the lock in the "bluetooth_conn" was not initialized, which resulted in
a blocking situation when attempting to hold the lock for the first
time.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu
2026-01-21 08:32:17 +08:00
committed by Xiang Xiao
parent 3448e84a4c
commit 646010d0a0
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -166,6 +166,8 @@ void bluetooth_conn_free(FAR struct bluetooth_conn_s *conn)
bluetooth_container_free(container);
}
nxrmutex_destroy(&conn->bc_conn.s_lock);
/* Free the connection structure */
NET_BUFPOOL_FREE(g_bluetooth_connections, conn);
+1
View File
@@ -127,6 +127,7 @@ static int bluetooth_sockif_alloc(FAR struct socket *psock)
DEBUGASSERT(conn->bc_crefs == 0);
conn->bc_crefs = 1;
nxrmutex_init(&conn->bc_conn.s_lock);
/* Save the pre-allocated connection in the socket structure */