@@ -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))
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(-)