[MERGED] osmo-bts[master]: l1sap: fix wrong return value of is_fill_frame()

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Nov 5 19:08:19 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: l1sap: fix wrong return value of is_fill_frame()
......................................................................


l1sap: fix wrong return value of is_fill_frame()

When determining if a frame is a fill frame or not, the case
statement only conditionally handled AGCH and PCH cases.  In
case a non-fill-frame was observed, the return value was uninitialized,
resulting in some non-fill-frames to be missed from GMSTAP

Change-Id: I7b46c720e34cb8ef9a91ae5da28a050439a1937d
Closes: Coverity CID#174175
---
M src/common/l1sap.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 763b355..ebcfd2f 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -335,9 +335,9 @@
 		if (!memcmp(data, paging_fill, GSM_MACBLOCK_LEN))
 			return true;
 		break;
-	default:
-		return false;
+	/* don't use 'default' case here as the above only conditionally return true */
 	}
+	return false;
 }
 
 static int to_gsmtap(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7b46c720e34cb8ef9a91ae5da28a050439a1937d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list