Skip to content

Commit eb23027

Browse files
committed
nimble/ll: Add missing NULL pointer check
Fix potential NULL dereference that occurs when cancelling extended discovery.
1 parent 9d0217a commit eb23027

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

nimble/controller/src/ble_ll_sched.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,11 @@ ble_ll_sched_rmv_elem_type(uint8_t type, sched_remove_cb_func remove_cb)
920920
OS_ENTER_CRITICAL(sr);
921921

922922
first = TAILQ_FIRST(&g_ble_ll_sched_q);
923+
if (!first) {
924+
OS_EXIT_CRITICAL(sr);
925+
return;
926+
}
927+
923928
if (first->sched_type == type) {
924929
first_removed = 1;
925930
}

0 commit comments

Comments
 (0)