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 a2403db0f nimble/ll: Add null check before removing scheduled conn
request
a2403db0f is described below
commit a2403db0faaaa6a32e02f6876f6196efca463c48
Author: Szymon Czapracki <[email protected]>
AuthorDate: Tue Dec 2 09:55:09 2025 +0100
nimble/ll: Add null check before removing scheduled conn request
The connection request cancel function could attempt to remove a
scheduler element even when no connection state machine was assigned.
To prevent this, a null check was added before removing the scheduler
element. If no connection state machine is present, the function now
returns early.
This change prevents potential crashes when the controller attempts
to clean up after failed connection creation.
---
nimble/controller/src/ble_ll_conn.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/nimble/controller/src/ble_ll_conn.c
b/nimble/controller/src/ble_ll_conn.c
index 206d290b9..32d0c8aea 100644
--- a/nimble/controller/src/ble_ll_conn.c
+++ b/nimble/controller/src/ble_ll_conn.c
@@ -3310,6 +3310,9 @@ ble_ll_conn_send_connect_req_cancel(void)
struct ble_ll_conn_sm *connsm;
connsm = g_ble_ll_conn_create_sm.connsm;
+ if (connsm == NULL) {
+ return;
+ }
ble_ll_sched_rmv_elem(&connsm->conn_sch);
}