Change in osmo-bsc[master]: fix rc handling in channel_mode_from_lchan()

neels gerrit-no-reply at lists.osmocom.org
Wed Jun 2 18:31:05 UTC 2021


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24517 )


Change subject: fix rc handling in channel_mode_from_lchan()
......................................................................

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
---
M src/osmo-bsc/abis_rsl.c
1 file changed, 5 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/17/24517/1

diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 9378ecb..1fb4c04 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -354,6 +354,7 @@
 				   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 @@
 		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:

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24517
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I52e13b24ce67e288ff32dbdaa1c1759089926f5c
Gerrit-Change-Number: 24517
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210602/ff6b9b7d/attachment.htm>


More information about the gerrit-log mailing list