Neels Hofmeyr has uploaded this change for review. (
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.
The warning was introduced in recent 946d1fb5c7f4a593567b407222c9235f8fac7a59
Related: CID 189671
Change-Id: I62354aa998832131c86535f39a29294000114adc
---
M src/osmo-bsc/bsc_subscr_conn_fsm.c
1 file changed, 4 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/42/11742/1
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c
b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 4d6521f..3a4ae7e 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -652,7 +652,7 @@
void gscon_forget_lchan(struct gsm_subscriber_connection *conn, struct
gsm_lchan *lchan)
{
const char *detach_label = NULL;
- if (!conn)
+ if (!conn || !conn->fi)
return;
if (!lchan)
return;
@@ -672,13 +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)",
+ osmo_fsm_inst_name(conn->fi) : "(conn without
FSM)",
detach_label);
}
--
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: newchange
Gerrit-Change-Id: I62354aa998832131c86535f39a29294000114adc
Gerrit-Change-Number: 11742
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <[email protected]>