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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Fri Jun 4 11:31:06 UTC 2021


neels has submitted this change. ( 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(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified



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: 2
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210604/300a3cb1/attachment.htm>


More information about the gerrit-log mailing list