Blame SOURCES/0015-scsi-scsi-qla2xxx-remove-redundant-null-check-on-poi.patch

3c6e85
From e00f15274ba0277d0d9749b1155ff241cfc60b26 Mon Sep 17 00:00:00 2001
3c6e85
From: Himanshu Madhani <hmadhani@redhat.com>
3c6e85
Date: Thu, 1 Aug 2019 15:54:35 -0400
3c6e85
Subject: [PATCH 015/124] [scsi] scsi: qla2xxx: remove redundant null check on
3c6e85
 pointer sess
3c6e85
3c6e85
Message-id: <20190801155618.12650-16-hmadhani@redhat.com>
3c6e85
Patchwork-id: 267789
3c6e85
O-Subject: [RHEL 7.8 e-stor PATCH 015/118] scsi: qla2xxx: remove redundant null check on pointer sess
3c6e85
Bugzilla: 1729270
3c6e85
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
3c6e85
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
3c6e85
3c6e85
From: Colin Ian King <colin.king@canonical.com>
3c6e85
3c6e85
Bugzilla 1729270
3c6e85
3c6e85
The null check on pointer sess and the subsequent call is redundant as sess
3c6e85
is null on all the the paths that lead to the out_term2 label.  Hence the
3c6e85
null check and the call can be removed.  Also remove the redundant setting
3c6e85
of sess to NULL as this is not required now.
3c6e85
3c6e85
Detected by CoverityScan, CID#1420663 ("Logically dead code")
3c6e85
3c6e85
Signed-off-by: Colin Ian King <colin.king@canonical.com>
3c6e85
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
3c6e85
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
3c6e85
(cherry picked from commit bb6abdd453e123bebdf949a03df5e846ecb5866b)
3c6e85
Signed-off-by: Himanshu Madhani <hmadhani@redhat.com>
3c6e85
Signed-off-by: Jan Stancek <jstancek@redhat.com>
3c6e85
---
3c6e85
 drivers/scsi/qla2xxx/qla_target.c | 6 +-----
3c6e85
 1 file changed, 1 insertion(+), 5 deletions(-)
3c6e85
3c6e85
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
3c6e85
index 54894e235c0d..50235fd29e45 100644
3c6e85
--- a/drivers/scsi/qla2xxx/qla_target.c
3c6e85
+++ b/drivers/scsi/qla2xxx/qla_target.c
3c6e85
@@ -6317,7 +6317,7 @@ static void qlt_tmr_work(struct qla_tgt *tgt,
3c6e85
 	struct atio_from_isp *a = &prm->tm_iocb2;
3c6e85
 	struct scsi_qla_host *vha = tgt->vha;
3c6e85
 	struct qla_hw_data *ha = vha->hw;
3c6e85
-	struct fc_port *sess = NULL;
3c6e85
+	struct fc_port *sess;
3c6e85
 	unsigned long flags;
3c6e85
 	uint8_t *s_id = NULL; /* to hide compiler warnings */
3c6e85
 	int rc;
3c6e85
@@ -6343,7 +6343,6 @@ static void qlt_tmr_work(struct qla_tgt *tgt,
3c6e85
 			goto out_term2;
3c6e85
 	} else {
3c6e85
 		if (sess->deleted) {
3c6e85
-			sess = NULL;
3c6e85
 			goto out_term2;
3c6e85
 		}
3c6e85
 
3c6e85
@@ -6351,7 +6350,6 @@ static void qlt_tmr_work(struct qla_tgt *tgt,
3c6e85
 			ql_dbg(ql_dbg_tgt_tmr, vha, 0xf020,
3c6e85
 			    "%s: kref_get fail %8phC\n",
3c6e85
 			     __func__, sess->port_name);
3c6e85
-			sess = NULL;
3c6e85
 			goto out_term2;
3c6e85
 		}
3c6e85
 	}
3c6e85
@@ -6370,8 +6368,6 @@ static void qlt_tmr_work(struct qla_tgt *tgt,
3c6e85
 	return;
3c6e85
 
3c6e85
 out_term2:
3c6e85
-	if (sess)
3c6e85
-		ha->tgt.tgt_ops->put_sess(sess);
3c6e85
 	spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
3c6e85
 out_term:
3c6e85
 	qlt_send_term_exchange(ha->base_qpair, NULL, &prm->tm_iocb2, 1, 0);
3c6e85
-- 
3c6e85
2.13.6
3c6e85