Review at https://gerrit.osmocom.org/6813
trxcon/scheduler: FIX: return NULL from TCH dequeue function Initially it was expected that a TCH transmit queue could contain TCH and FACCH primitives only. But there are also SACCH primitives, which are also being stored there. So, let's drop the assertations from the sched_prim_dequeue_tch(), and return NULL if nothing was found. Change-Id: Iae37057d35883c09a76f0612e52c2d14d9ff91cb --- M src/host/trxcon/sched_prim.c 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/13/6813/1 diff --git a/src/host/trxcon/sched_prim.c b/src/host/trxcon/sched_prim.c index da2ff3b..1f466a1 100644 --- a/src/host/trxcon/sched_prim.c +++ b/src/host/trxcon/sched_prim.c @@ -141,7 +141,7 @@ * dropped (i.e. replaced). * * @param queue a transmit queue to take a prim from - * @return a FACCH or TCH primitive + * @return a FACCH or TCH primitive, otherwise NULL */ static struct trx_ts_prim *sched_prim_dequeue_tch(struct llist_head *queue) { @@ -164,9 +164,6 @@ break; } - /* There should be at least one frame found */ - OSMO_ASSERT(facch || tch); - /* Prioritize FACCH */ if (facch && tch) { /* We found a pair, dequeue both */ @@ -188,8 +185,11 @@ return tch; } - /* Unreachable */ - OSMO_ASSERT(0); + /** + * Nothing was found, + * e.g. only SACCH frames are in queue + */ + return NULL; } /** -- To view, visit https://gerrit.osmocom.org/6813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iae37057d35883c09a76f0612e52c2d14d9ff91cb Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>