aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-06-02 20:28:16 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2021-06-02 20:36:57 +0200
commit063047ea7cce2001e0d6791f1d0e024616bae2ff (patch)
tree9630db68b583122365fef3953eb9e2f0f9862636 /src/osmo-bsc
parent2f88133083c74daebc331ccea1899af52085697a (diff)
fix rc handling in channel_mode_from_lchan()
chan_mode_to_rsl_cmod_spd() may actually return negative on error. To be able to check for that, handle the returned value as a signed rc before assigning to the unsigned spd_ind. Related: SYS#5315 OS#4940 CID#236231 Change-Id: I52e13b24ce67e288ff32dbdaa1c1759089926f5c
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r--src/osmo-bsc/abis_rsl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 9378ecb87..1fb4c0475 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -354,6 +354,7 @@ static int channel_mode_from_lchan(struct rsl_ie_chan_mode *cm,
struct gsm_lchan *lchan,
const struct channel_mode_and_rate *ch_mode_rate)
{
+ int rc;
memset(cm, 0, sizeof(*cm));
/* FIXME: what to do with data calls ? */
@@ -364,11 +365,12 @@ static int channel_mode_from_lchan(struct rsl_ie_chan_mode *cm,
cm->dtx_dtu |= RSL_CMOD_DTXd;
/* set TCH Speech/Data */
- cm->spd_ind = chan_mode_to_rsl_cmod_spd(ch_mode_rate->chan_mode);
- if (cm->spd_ind < 0) {
+ rc = chan_mode_to_rsl_cmod_spd(ch_mode_rate->chan_mode);
+ if (rc < 0) {
LOGP(DRSL, LOGL_ERROR, "unsupported: chan_mode = 0x%02x\n", ch_mode_rate->chan_mode);
- return cm->spd_ind;
+ return rc;
}
+ cm->spd_ind = rc;
switch (lchan->type) {
case GSM_LCHAN_SDCCH: