From b6f565c97da5aeef8f5a490ea259379265c76b18 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 9 Aug 2016 11:15:37 +0200 Subject: 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 --- openbsc/src/libcommon/gsm_data_shared.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'openbsc/src/libcommon') 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; -- cgit v1.2.3