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
This commit is contained in:
Neels Hofmeyr 2018-11-12 16:37:23 +01:00
parent ad2c15da14
commit ce4224f86c
1 changed files with 3 additions and 5 deletions

View File

@ -672,14 +672,12 @@ void gscon_forget_lchan(struct gsm_subscriber_connection *conn, struct gsm_lchan
/* 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