You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2022/06/22 13:18:27 UTC

[mynewt-nimble] 07/12: nimble/ll/css: Fix updating ref connsm after disconnection

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

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

commit 9ad6b101d75c7a78a34edf6cae0048b8b92400c6
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Mon Jun 13 14:58:20 2022 +0200

    nimble/ll/css: Fix updating ref connsm after disconnection
    
    We should look for new reference connsm in critical section since ref
    connsm can be also accessed from isr code.
---
 nimble/controller/src/ble_ll_conn.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nimble/controller/src/ble_ll_conn.c b/nimble/controller/src/ble_ll_conn.c
index 94f0930e..d2ef1bfd 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -2077,6 +2077,7 @@ ble_ll_conn_end(struct ble_ll_conn_sm *connsm, uint8_t ble_err)
     /* If current connection was reference for CSS, we need to find another
      * one. It does not matter which one we'll pick.
      */
+    OS_ENTER_CRITICAL(sr);
     if (connsm == g_ble_ll_conn_css_ref) {
         SLIST_FOREACH(g_ble_ll_conn_css_ref, &g_ble_ll_conn_active_list,
                       act_sle) {
@@ -2085,6 +2086,7 @@ ble_ll_conn_end(struct ble_ll_conn_sm *connsm, uint8_t ble_err)
             }
         }
     }
+    OS_EXIT_CRITICAL(sr);
 #endif
 
 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_CTRL_TO_HOST_FLOW_CONTROL)