qla2xxx: Fix scsi_host leak on qlt_lport_register callback failure

This patch fixes a possible scsi_host reference leak in qlt_lport_register(),
when a non zero return from the passed (*callback) does not call drop the
local reference via scsi_host_put() before returning.

This currently does not effect existing tcm_qla2xxx code as the passed callback
will never fail, but fix this up regardless for future code.

Cc: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

Changed files
+1
drivers
scsi
qla2xxx
+1
drivers/scsi/qla2xxx/qla_target.c
··· 4291 4291 if (rc != 0) { 4292 4292 ha->tgt.tgt_ops = NULL; 4293 4293 ha->tgt.target_lport_ptr = NULL; 4294 + scsi_host_put(host); 4294 4295 } 4295 4296 mutex_unlock(&qla_tgt_mutex); 4296 4297 return rc;