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@xxxxxxxxxxx> Cc: Himanshu Madhani <himanshu.madhani@xxxxxxxxxx> Cc: Quinn Tran <quinn.tran@xxxxxxxxxx> --- drivers/scsi/qla2xxx/qla_target.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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)) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html