From: Wei Yongjun <weiyj.lk@gmail.com>
To: "James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Manish Rangankar <manish.rangankar@cavium.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
QLogic-Storage-Upstream@cavium.com, linux-scsi@vger.kernel.org
Subject: [PATCH -next] scsi: qedi: Fix possible memory leak in qedi_iscsi_update_conn()
Date: Tue, 7 Feb 2017 14:52:58 +0000 [thread overview]
Message-ID: <20170207145258.31429-1-weiyj.lk@gmail.com> (raw)
From: Wei Yongjun <weiyongjun1@huawei.com>
'conn_info' is malloced in qedi_iscsi_update_conn() and should be
freed before leaving from the error handling cases, otherwise it
will cause memory leak.
Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI
driver framework.")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/scsi/qedi/qedi_iscsi.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c
index d6a2054..eb64469 100644
--- a/drivers/scsi/qedi/qedi_iscsi.c
+++ b/drivers/scsi/qedi/qedi_iscsi.c
@@ -453,13 +453,9 @@ static int qedi_iscsi_update_conn(struct qedi_ctx *qedi,
if (rval) {
rval = -ENXIO;
QEDI_ERR(&qedi->dbg_ctx, "Could not update connection\n");
- goto update_conn_err;
}
kfree(conn_info);
- rval = 0;
-
-update_conn_err:
return rval;
}
next reply other threads:[~2017-02-07 14:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-07 14:52 Wei Yongjun [this message]
2017-02-08 5:51 ` [PATCH -next] scsi: qedi: Fix possible memory leak in qedi_iscsi_update_conn() Rangankar, Manish
2017-02-09 23:35 ` Martin K. Petersen
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=20170207145258.31429-1-weiyj.lk@gmail.com \
--to=weiyj.lk@gmail.com \
--cc=QLogic-Storage-Upstream@cavium.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=manish.rangankar@cavium.com \
--cc=martin.petersen@oracle.com \
--cc=weiyongjun1@huawei.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