This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new e33099a19 nimble/host: Fix possible deadlock in ble_att_tx
e33099a19 is described below

commit e33099a190739b8df6689f808d4053fc51b37c1c
Author: Szymon Janc <[email protected]>
AuthorDate: Tue Mar 12 17:17:17 2024 +0100

    nimble/host: Fix possible deadlock in ble_att_tx
    
    If ble_hs_misc_conn_chan_find_reqd() failed function would exit with
    HS lock locked.
---
 nimble/host/src/ble_att_cmd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/nimble/host/src/ble_att_cmd.c b/nimble/host/src/ble_att_cmd.c
index 4106cd060..4760ff60d 100644
--- a/nimble/host/src/ble_att_cmd.c
+++ b/nimble/host/src/ble_att_cmd.c
@@ -114,6 +114,7 @@ ble_att_tx(uint16_t conn_handle, uint16_t cid, struct 
os_mbuf *txom)
     rc = ble_hs_misc_conn_chan_find_reqd(conn_handle, BLE_L2CAP_CID_ATT, &conn,
                                          &chan);
     if (rc != 0) {
+        ble_hs_unlock();
         os_mbuf_free_chain(txom);
         return rc;
     }

Reply via email to