From 2f7a8d5a5bbf3a1c4e62df35ce1e57d93508caf9 Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Thu, 28 Mar 2019 23:11:24 +0100 Subject: [PATCH] nimble/ll: Remove DTM event from queue before erasing context If event is already queued, we should remove it from queue before erasing context as otherwise callback and link will be removed which leads to a crash when event is run, --- nimble/controller/src/ble_ll_dtm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nimble/controller/src/ble_ll_dtm.c b/nimble/controller/src/ble_ll_dtm.c index 31035eea9..253a7e262 100644 --- a/nimble/controller/src/ble_ll_dtm.c +++ b/nimble/controller/src/ble_ll_dtm.c @@ -427,6 +427,7 @@ ble_ll_dtm_ctx_free(struct dtm_ctx * ctx) OS_EXIT_CRITICAL(sr); ble_ll_sched_rmv_elem(&ctx->sch); + ble_npl_eventq_remove(&g_ble_ll_data.ll_evq, &g_ble_ll_dtm_ctx.evt); ble_phy_disable(); ble_phy_disable_dtm();