Change in osmo-bts[master]: [VAMOS] l1sap: get_lchan_by_chan_nr() may return NULL

laforge gerrit-no-reply at lists.osmocom.org
Fri Jun 4 20:04:17 UTC 2021


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

Change subject: [VAMOS] l1sap: get_lchan_by_chan_nr() may return NULL
......................................................................

[VAMOS] l1sap: get_lchan_by_chan_nr() may return NULL

Change-Id: Ic309622d0ee818302dfc66d69fd2914ae28261d6
---
M src/common/l1sap.c
1 file changed, 12 insertions(+), 0 deletions(-)

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



diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index a47f653..b0cffe5 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -765,6 +765,12 @@
 	struct info_act_cnf_param *info_act_cnf)
 {
 	struct gsm_lchan *lchan = get_lchan_by_chan_nr(trx, info_act_cnf->chan_nr);
+	if (lchan == NULL) {
+		LOGPTRX(trx, DL1C, LOGL_ERROR, "get_lchan_by_chan_nr(chan_nr=%s) "
+			"yields NULL for PRIM_INFO_ACTIVATE.conf\n",
+			rsl_chan_nr_str(info_act_cnf->chan_nr));
+		return -ENODEV;
+	}
 
 	LOGPLCHAN(lchan, DL1C, LOGL_INFO, "activate confirm chan_nr=%s trx=%d\n",
 		  rsl_chan_nr_str(info_act_cnf->chan_nr), trx->nr);
@@ -788,6 +794,12 @@
 	struct info_act_cnf_param *info_act_cnf)
 {
 	struct gsm_lchan *lchan = get_lchan_by_chan_nr(trx, info_act_cnf->chan_nr);
+	if (lchan == NULL) {
+		LOGPTRX(trx, DL1C, LOGL_ERROR, "get_lchan_by_chan_nr(chan_nr=%s) "
+			"yields NULL for PRIM_INFO_ACTIVATE.conf\n",
+			rsl_chan_nr_str(info_act_cnf->chan_nr));
+		return -ENODEV;
+	}
 
 	LOGPLCHAN(lchan, DL1C, LOGL_INFO, "deactivate confirm chan_nr=%s trx=%d\n",
 		  rsl_chan_nr_str(info_act_cnf->chan_nr), trx->nr);

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ic309622d0ee818302dfc66d69fd2914ae28261d6
Gerrit-Change-Number: 24483
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210604/fcb5bce7/attachment.htm>


More information about the gerrit-log mailing list