Change in osmo-bsc[master]: assignment_fsm: Add assert to guard ptr access

laforge gerrit-no-reply at lists.osmocom.org
Mon Jul 5 20:11:11 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24849 )

Change subject: assignment_fsm: Add assert to guard ptr access
......................................................................

assignment_fsm: Add assert to guard ptr access

Let's make sure the null pointer is caught by the assert if ever code
ends up here with conn->lchan being NULL.

Change-Id: I404df638da6a93caa535f10fd330ea24a775bfc3
---
M src/osmo-bsc/assignment_fsm.c
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index 928d3b2..2c52d22 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -575,6 +575,7 @@
 			matching_mode = true;
 		}
 		if (!matching_mode) {
+			OSMO_ASSERT(conn->lchan);
 			assignment_fail(GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE,
 					"Assignment of lchan %s to %s type %s requested, but lchan is not compatible",
 					gsm_lchan_name(conn->lchan),

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24849
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I404df638da6a93caa535f10fd330ea24a775bfc3
Gerrit-Change-Number: 24849
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210705/46e7caba/attachment.htm>


More information about the gerrit-log mailing list