diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-12-17 01:51:22 -0800 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-12-19 14:50:17 -0800 |
commit | dcd211997ddba3229e875f5990ea14f920934729 (patch) | |
tree | bdd54eb2023c9d05ce97d2ea9377d2c20a2672af /drivers/scsi | |
parent | de06875f089678f4f9f1e8d5e1421fb0ceab12d0 (diff) |
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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 3bb0a1d1622..38a1257e76e 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -4291,6 +4291,7 @@ int qlt_lport_register(struct qla_tgt_func_tmpl *qla_tgt_ops, u64 wwpn, if (rc != 0) { ha->tgt.tgt_ops = NULL; ha->tgt.target_lport_ptr = NULL; + scsi_host_put(host); } mutex_unlock(&qla_tgt_mutex); return rc; |