From c1e26371c6fed7a18e7b6d06b0b182a2bafba969 Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Thu, 14 Sep 2023 03:27:04 +0100 Subject: [PATCH] Fix a bug in ble_l2cap_sig_extract_expired Next should be updated to point at the previous element in the list for removal to work correctly. --- nimble/host/src/ble_l2cap_sig.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nimble/host/src/ble_l2cap_sig.c b/nimble/host/src/ble_l2cap_sig.c index 42459179b..029e85538 100644 --- a/nimble/host/src/ble_l2cap_sig.c +++ b/nimble/host/src/ble_l2cap_sig.c @@ -1905,9 +1905,10 @@ ble_l2cap_sig_extract_expired(struct ble_l2cap_sig_proc_list *dst_list) ble_hs_lock(); - prev = NULL; + next = NULL; proc = STAILQ_FIRST(&ble_l2cap_sig_procs); while (proc != NULL) { + prev = next; next = STAILQ_NEXT(proc, next); time_diff = proc->exp_os_ticks - now;