aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libcommon
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2016-08-09 11:15:37 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2016-08-10 17:14:53 +0200
commitb6f565c97da5aeef8f5a490ea259379265c76b18 (patch)
treec004821cd6791e09a37d24ac39c8e0e5ec4cb05f /openbsc/src/libcommon
parent2f44693fad8505255293d3ed37dbd4e7cabebd37 (diff)
gsm_pchan2chan_nr(): fix uninitialized cbits
Commit ec1b5a0e9e2b6549e0ede48e803095e569997355 introduced an unset cbits value for the 'special hack for BCCH', where I break out of the switch without setting cbits. Fix that. Also remove the comment part that says 'return 0', because I don't return 0. Change-Id: I54129d921807971eeafc23f80c57666c67b71377
Diffstat (limited to 'openbsc/src/libcommon')
-rw-r--r--openbsc/src/libcommon/gsm_data_shared.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c
index 529f72cfc..2488c3afd 100644
--- a/openbsc/src/libcommon/gsm_data_shared.c
+++ b/openbsc/src/libcommon/gsm_data_shared.c
@@ -573,14 +573,13 @@ uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan,
case GSM_PCHAN_CCCH_SDCCH4_CBCH:
/*
* As a special hack for BCCH, lchan_nr == 4 may be passed
- * here. This should never be sent in an RSL message, so just
- * return 0. See osmo-bts-xxx/oml.c:opstart_compl().
+ * here. This should never be sent in an RSL message.
+ * See osmo-bts-xxx/oml.c:opstart_compl().
*/
- if (lchan_nr == 4) {
+ if (lchan_nr == 4)
chan_nr = 0;
- break;
- }
- OSMO_ASSERT(lchan_nr < 4);
+ else
+ OSMO_ASSERT(lchan_nr < 4);
cbits = 0x04;
cbits += lchan_nr;
break;