Avoid that the fcport structure gets leaked if
bsg_job->request->msgcode == FC_BSG_HST_ELS_NOLOGIN, the fcport
allocation succeeds and the !vha->flags.online branch is taken.
Detected by Coverity.

Signed-off-by: Bart Van Assche <bvanass...@acm.org>
Cc: Chad Dupuis <chad.dup...@qlogic.com>
Cc: Saurav Kashyap <saurav.kash...@qlogic.com>
---
 drivers/scsi/qla2xxx/qla_bsg.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index 39719f8..af35707 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -329,7 +329,7 @@ qla2x00_process_els(struct fc_bsg_job *bsg_job)
        if (!vha->flags.online) {
                ql_log(ql_log_warn, vha, 0x7005, "Host not online.\n");
                rval = -EIO;
-               goto done;
+               goto done_free_fcport;
        }
 
        req_sg_cnt =
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to