You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2019/03/28 23:15:29 UTC

[mynewt-nimble] branch master updated: nimble/ll: Remove DTM event from queue before erasing context

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

andk 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 8d78bbf  nimble/ll: Remove DTM event from queue before erasing context
8d78bbf is described below

commit 8d78bbfdf00820a9f27846eada1107f5a59f9789
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Thu Mar 28 23:11:24 2019 +0100

    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 31035ee..253a7e2 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();