From: "Jitendra Bhivare" <jitendra.bhivare@broadcom.com>
To: linux-scsi@vger.kernel.org, mlombard@redhat.com
Cc: jayamohan.kallickal@avagotech.com, minh.tran@avagotech.com,
sony.john-n@avagotech.com, James.Bottomley@hansenpartnership.com
Subject: RE: [PATCH] be2iscsi: Fix memory leak in beiscsi_alloc_mem()
Date: Thu, 11 Feb 2016 04:59:31 -0800 [thread overview]
Message-ID: <026a01d164cc$0eed1720$2cc74560$@broadcom.com> (raw)
In-Reply-To: <CAJRCtXfbT9OrVVDrnC=1V1B4iFUm+FHN4fxQV1CUCY3pXRHq2Q@mail.gmail.com>
In case of error, the memory allocated for phwi_ctrlr was not freed.
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
drivers/scsi/be2iscsi/be_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 7a6dbfb..360aa88 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -2706,8 +2706,10 @@ static int beiscsi_alloc_mem(struct beiscsi_hba *phba)
phwi_ctrlr->wrb_context = kzalloc(sizeof(struct hwi_wrb_context) *
phba->params.cxns_per_ctrl,
GFP_KERNEL);
- if (!phwi_ctrlr->wrb_context)
+ if (!phwi_ctrlr->wrb_context) {
+ kfree(phba->phwi_ctrlr);
return -ENOMEM;
+ }
phba->init_mem = kcalloc(SE_MEM_MAX, sizeof(*mem_descr),
GFP_KERNEL);
--
Maurizio Lombardi
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Reviewed-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Thanks,
JB
next prev parent reply other threads:[~2016-02-11 12:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-01 8:56 [PATCH] be2iscsi: Fix memory leak in beiscsi_alloc_mem() Maurizio Lombardi
2016-02-10 10:13 ` Maurizio Lombardi
2016-02-10 11:07 ` Johannes Thumshirn
2016-02-10 17:23 ` Martin K. Petersen
[not found] ` <CAJRCtXfbT9OrVVDrnC=1V1B4iFUm+FHN4fxQV1CUCY3pXRHq2Q@mail.gmail.com>
2016-02-11 12:59 ` Jitendra Bhivare [this message]
2016-02-11 14:34 ` 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='026a01d164cc$0eed1720$2cc74560$@broadcom.com' \
--to=jitendra.bhivare@broadcom.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=jayamohan.kallickal@avagotech.com \
--cc=linux-scsi@vger.kernel.org \
--cc=minh.tran@avagotech.com \
--cc=mlombard@redhat.com \
--cc=sony.john-n@avagotech.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.