From 6c0b1261a3cb62b578bf3f86d06f5498e70bf589 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Thu, 28 Dec 2017 19:44:49 +0100 Subject: 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 --- src/host/trxcon/sched_prim.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/host/trxcon/sched_prim.c b/src/host/trxcon/sched_prim.c index da2ff3be..1f466a1e 100644 --- a/src/host/trxcon/sched_prim.c +++ b/src/host/trxcon/sched_prim.c @@ -141,7 +141,7 @@ int sched_prim_push(struct trx_instance *trx, * 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 @@ static struct trx_ts_prim *sched_prim_dequeue_tch(struct llist_head *queue) 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 @@ static struct trx_ts_prim *sched_prim_dequeue_tch(struct llist_head *queue) return tch; } - /* Unreachable */ - OSMO_ASSERT(0); + /** + * Nothing was found, + * e.g. only SACCH frames are in queue + */ + return NULL; } /** -- cgit v1.2.3