aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-11-06 02:56:41 +0900
committerHarald Welte <laforge@gnumonks.org>2017-11-06 02:56:41 +0900
commit8e202b595cb1ff6abc1e56f7db599f3307b8e14c (patch)
tree25e967a1d8e16feadb1ead72f91d0ea5cf7d9ad4 /src/osmo-bts-trx
parentd8d402099f3a47d7b50fdab79a6c55d57937bfa7 (diff)
trx: Don't call osmo_fr_check_sid with negative 'rc'
In rx_tchf_fn(), if gsm0503_tch_fr_decode() returns a negative result, we cannot use that result as length argument to osmo_fr_check_sid() Change-Id: Ic4080b5bf6c865be3333f923f19a2340e1e272c8 Fixes: Coverity CID#178659
Diffstat (limited to 'src/osmo-bts-trx')
-rw-r--r--src/osmo-bts-trx/scheduler_trx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 967e3db1..c849dd52 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -1055,7 +1055,8 @@ int rx_tchf_fn(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
: tch_mode) {
case GSM48_CMODE_SPEECH_V1: /* FR */
rc = gsm0503_tch_fr_decode(tch_data, *bursts_p, 1, 0, &n_errors, &n_bits_total);
- lchan_set_marker(osmo_fr_check_sid(tch_data, rc), lchan); /* DTXu */
+ if (rc >= 0)
+ lchan_set_marker(osmo_fr_check_sid(tch_data, rc), lchan); /* DTXu */
break;
case GSM48_CMODE_SPEECH_EFR: /* EFR */
rc = gsm0503_tch_fr_decode(tch_data, *bursts_p, 1, 1, &n_errors, &n_bits_total);