You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ha...@apache.org on 2021/10/28 07:59:37 UTC

[mynewt-nimble] branch master updated: controller: fix assert bug in ble_ll_sched_insert()

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

hauke 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 8d66e40  controller: fix assert bug in  ble_ll_sched_insert()
8d66e40 is described below

commit 8d66e40cc901ac37eccea54752df0803879c1e57
Author: Hauke Petersen <ha...@fu-berlin.de>
AuthorDate: Mon Oct 25 12:34:16 2021 +0200

    controller: fix assert bug in  ble_ll_sched_insert()
    
    When trying to schedule connection events for a connection while
    there are already advertising events as well as connections events
    for other connections in the queue, ble_ll_sched_insert() triggers
    an assertion failure. This happens, because `preemt_first` is not
    reset for the case that the new event can not be scheduled. This
    commit fixes this issue.
---
 nimble/controller/src/ble_ll_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nimble/controller/src/ble_ll_sched.c b/nimble/controller/src/ble_ll_sched.c
index 1eb7d54..1c7db41 100644
--- a/nimble/controller/src/ble_ll_sched.c
+++ b/nimble/controller/src/ble_ll_sched.c
@@ -222,6 +222,7 @@ ble_ll_sched_insert(struct ble_ll_sched_item *sch, uint32_t max_delay,
                     preempt_first = entry;
                 }
             } else {
+                preempt_first = NULL;
                 sch->start_time = entry->end_time;
 
                 if ((max_delay == 0) || CPUTIME_GEQ(sch->start_time,
@@ -231,7 +232,6 @@ ble_ll_sched_insert(struct ble_ll_sched_item *sch, uint32_t max_delay,
                 }
 
                 sch->end_time = sch->start_time + duration;
-                preempt_first = NULL;
             }
         }
     }