[PATCH] openbsc[master]: gsm_pchan2chan_nr(): fix uninitialized cbits

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 Hofmeyr gerrit-no-reply at lists.osmocom.org
Tue Aug 9 09:16:51 UTC 2016


Review at  https://gerrit.osmocom.org/666

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: If69f6b1f6208138d5b91bac51ffd78dab95245e5
---
M openbsc/src/libcommon/gsm_data_shared.c
1 file changed, 5 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/66/666/1

diff --git a/openbsc/src/libcommon/gsm_data_shared.c b/openbsc/src/libcommon/gsm_data_shared.c
index 7c6b3e4..0a38528 100644
--- a/openbsc/src/libcommon/gsm_data_shared.c
+++ b/openbsc/src/libcommon/gsm_data_shared.c
@@ -573,14 +573,13 @@
 	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;

-- 
To view, visit https://gerrit.osmocom.org/666
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If69f6b1f6208138d5b91bac51ffd78dab95245e5
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: neels_test_account <neels at hofmeyr.de>



More information about the gerrit-log mailing list