diff mbox

[v6,01/33] tcm_qla2xxx: Simplify qlt_create_sess()

Message ID 20170215002612.14566-2-bart.vanassche@sandisk.com (mailing list archive)
State Superseded
Headers show

Commit Message

Bart Van Assche Feb. 15, 2017, 12:25 a.m. UTC
Just after creation of a session it only has a single user. Hence
using kref_get() is sufficient.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Himanshu Madhani <himanshu.madhani@cavium.com>
Cc: Quinn Tran <quinn.tran@cavium.com>
---
 drivers/scsi/qla2xxx/qla_target.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 45f5077684f0..02d4aee5c422 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -1292,14 +1292,9 @@  static struct fc_port *qlt_create_sess(
 		kref_init(&fcport->sess_kref);
 		/*
 		 * Take an extra reference to ->sess_kref here to handle
-		 * fc_port access across ->tgt.sess_lock reaquire.
+		 * fc_port access across ->tgt.sess_lock reacquire.
 		 */
-		if (!kref_get_unless_zero(&sess->sess_kref)) {
-			ql_dbg(ql_dbg_disc, vha, 0xffff,
-			    "%s: kref_get_unless_zero failed for %8phC\n",
-			    __func__, sess->port_name);
-			return NULL;
-		}
+		kref_get(&sess->sess_kref);
 
 		spin_lock_irqsave(&ha->tgt.sess_lock, flags);
 		if (!IS_SW_RESV_ADDR(sess->d_id))