Change in osmo-bsc[master]: coverity: gscon_forget_lchan: squelch forward-null

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
Wed Nov 14 17:38:56 UTC 2018


Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/11742 )

Change subject: coverity: gscon_forget_lchan: squelch forward-null
......................................................................

coverity: gscon_forget_lchan: squelch forward-null

conn->fi should actually never be NULL, they are allocated and discarded
simultaneously. So check its null from the start and remove some conditions
below, to remove the coverity warning.

Related: CID 189671
Change-Id: I62354aa998832131c86535f39a29294000114adc
---
M src/osmo-bsc/bsc_subscr_conn_fsm.c
1 file changed, 3 insertions(+), 5 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 0dd21d9..d2ca03e 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -672,14 +672,12 @@
 
 	/* Log for both lchan FSM and conn FSM to ease reading the log in case of problems */
 	if (detach_label) {
-		if (conn->fi)
-			LOGPFSML(conn->fi, LOGL_DEBUG, "conn detaches lchan %s\n",
-				 lchan->fi? osmo_fsm_inst_name(lchan->fi) : gsm_lchan_name(lchan));
+		LOGPFSML(conn->fi, LOGL_DEBUG, "conn detaches lchan %s\n",
+			 lchan->fi? osmo_fsm_inst_name(lchan->fi) : gsm_lchan_name(lchan));
 
 		if (lchan->fi)
 			LOGPFSML(lchan->fi, LOGL_DEBUG, "conn %s detaches lchan (%s)\n",
-				 conn->fi? osmo_fsm_inst_name(conn->fi) : "(conn without FSM)",
-				 detach_label);
+				 osmo_fsm_inst_name(conn->fi), detach_label);
 	}
 
 	if (conn->fi->state != ST_CLEARING

-- 
To view, visit https://gerrit.osmocom.org/11742
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I62354aa998832131c86535f39a29294000114adc
Gerrit-Change-Number: 11742
Gerrit-PatchSet: 4
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181114/69a1a14e/attachment.htm>


More information about the gerrit-log mailing list