mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
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:
parent
3448e84a4c
commit
646010d0a0
2 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue