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

sjanc 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 fcaa3d5ef host/gap: Handle BLE_GAP_OP_NULL in ble_gap_master_failed
fcaa3d5ef is described below

commit fcaa3d5ef678c89ef8db8474bf31a4d24a947dfa
Author: Deomid rojer Ryabkov <[email protected]>
AuthorDate: Sat Apr 18 00:00:06 2026 +0300

    host/gap: Handle BLE_GAP_OP_NULL in ble_gap_master_failed
    
    ble_gap_reset_state() calls ble_gap_master_failed() unconditionally.
    When no master procedure is active (op == BLE_GAP_OP_NULL), this
    hits an unconditional BLE_HS_DBG_ASSERT(0) in the default case.
    
    This happens when the host is stopped while no scanning or connection
    is in progress.
    
    Add an explicit case for BLE_GAP_OP_NULL that does nothing.
---
 nimble/host/src/ble_gap.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index 62eef56de..9588a14e9 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -1198,6 +1198,9 @@ static void
 ble_gap_master_failed(int status)
 {
     switch (ble_gap_master.op) {
+    case BLE_GAP_OP_NULL:
+        break;
+
 #if NIMBLE_BLE_CONNECT
     case BLE_GAP_OP_M_CONN:
         STATS_INC(ble_gap_stats, initiate_fail);

Reply via email to