From: Bart Van Assche <bvanassche@acm.org>
To: Chad Dupuis <chad.dupuis@qlogic.com>,
Saurav Kashyap <saurav.kashyap@qlogic.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>
Subject: [PATCH] qla2x00t: Fix a memory leak in an error path
Date: Sat, 11 May 2013 14:38:15 +0200 [thread overview]
Message-ID: <518E3BB7.20109@acm.org> (raw)
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 <bvanassche@acm.org>
Cc: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: Saurav Kashyap <saurav.kashyap@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
next reply other threads:[~2013-05-11 12:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-11 12:38 Bart Van Assche [this message]
2013-05-17 5:00 ` [PATCH] qla2x00t: Fix a memory leak in an error path Saurav Kashyap
2013-05-17 12:03 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=518E3BB7.20109@acm.org \
--to=bvanassche@acm.org \
--cc=chad.dupuis@qlogic.com \
--cc=linux-scsi@vger.kernel.org \
--cc=saurav.kashyap@qlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox