Commit bb6abdd4 authored by Colin Ian King's avatar Colin Ian King Committed by Martin K. Petersen

scsi: qla2xxx: remove redundant null check on pointer sess

The null check on pointer sess and the subsequent call is redundant as sess
is null on all the the paths that lead to the out_term2 label.  Hence the
null check and the call can be removed.  Also remove the redundant setting
of sess to NULL as this is not required now.

Detected by CoverityScan, CID#1420663 ("Logically dead code")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f233e8c0
...@@ -6343,7 +6343,7 @@ static void qlt_tmr_work(struct qla_tgt *tgt, ...@@ -6343,7 +6343,7 @@ static void qlt_tmr_work(struct qla_tgt *tgt,
struct atio_from_isp *a = &prm->tm_iocb2; struct atio_from_isp *a = &prm->tm_iocb2;
struct scsi_qla_host *vha = tgt->vha; struct scsi_qla_host *vha = tgt->vha;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
struct fc_port *sess = NULL; struct fc_port *sess;
unsigned long flags; unsigned long flags;
uint8_t *s_id = NULL; /* to hide compiler warnings */ uint8_t *s_id = NULL; /* to hide compiler warnings */
int rc; int rc;
...@@ -6369,7 +6369,6 @@ static void qlt_tmr_work(struct qla_tgt *tgt, ...@@ -6369,7 +6369,6 @@ static void qlt_tmr_work(struct qla_tgt *tgt,
goto out_term2; goto out_term2;
} else { } else {
if (sess->deleted) { if (sess->deleted) {
sess = NULL;
goto out_term2; goto out_term2;
} }
...@@ -6377,7 +6376,6 @@ static void qlt_tmr_work(struct qla_tgt *tgt, ...@@ -6377,7 +6376,6 @@ static void qlt_tmr_work(struct qla_tgt *tgt,
ql_dbg(ql_dbg_tgt_tmr, vha, 0xf020, ql_dbg(ql_dbg_tgt_tmr, vha, 0xf020,
"%s: kref_get fail %8phC\n", "%s: kref_get fail %8phC\n",
__func__, sess->port_name); __func__, sess->port_name);
sess = NULL;
goto out_term2; goto out_term2;
} }
} }
...@@ -6396,8 +6394,6 @@ static void qlt_tmr_work(struct qla_tgt *tgt, ...@@ -6396,8 +6394,6 @@ static void qlt_tmr_work(struct qla_tgt *tgt,
return; return;
out_term2: out_term2:
if (sess)
ha->tgt.tgt_ops->put_sess(sess);
spin_unlock_irqrestore(&ha->tgt.sess_lock, flags); spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
out_term: out_term:
qlt_send_term_exchange(ha->base_qpair, NULL, &prm->tm_iocb2, 1, 0); qlt_send_term_exchange(ha->base_qpair, NULL, &prm->tm_iocb2, 1, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment