From 2f88133083c74daebc331ccea1899af52085697a Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 2 Jun 2021 20:20:03 +0200 Subject: fixup for Mode Modify TSC Use lchan->modify.tsc in gsm48_lchan_modify(). The TSC is chosen exactly once upon LCHAN_EV_REQUEST_MODE_MODIFY (lchan_fsm.c), and that should be the only place calling gsm_ts_tsc(). All other mode modify code should just use the final lchan->modify.tsc. This fixes an error in patch: Ic665125255d7354f5499d10dda1dd866ab243d24 "allow explixit TSC Set and TSC on chan activ / modif / assignment" Thanks to coverity for actually detecting this mistake. Related: SYS#5315 OS#4940 CID#236233 Change-Id: I87ecf7d9266f37f4c775d029e277b614671a9401 --- src/osmo-bsc/gsm_04_08_rr.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/osmo-bsc/gsm_04_08_rr.c') diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index 058a1074a..5948e944c 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -681,7 +681,6 @@ int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t mode) struct gsm48_chan_mode_modify *cmm = (struct gsm48_chan_mode_modify *) msgb_put(msg, sizeof(*cmm)); struct gsm_bts *bts = lchan->ts->trx->bts; - uint8_t tsc; DEBUGP(DRR, "-> CHANNEL MODE MODIFY mode=0x%02x\n", mode); @@ -689,10 +688,7 @@ int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t mode) gh->proto_discr = GSM48_PDISC_RR; gh->msg_type = GSM48_MT_RR_CHAN_MODE_MODIF; - /* fill the channel information element, this code - * should probably be shared with rsl_rx_chan_rqd() */ - tsc = (lchan->modify.tsc >= 0) ? lchan->modify.tsc : gsm_ts_tsc(lchan->ts); - gsm48_lchan2chan_desc(&cmm->chan_desc, lchan, tsc); + gsm48_lchan2chan_desc(&cmm->chan_desc, lchan, lchan->modify.tsc); cmm->mode = mode; /* in case of multi rate we need to attach a config */ -- cgit v1.2.3