From: <vikas.chaudhary@qlogic.com>
To: jbottomley@parallels.com, michaelc@cs.wisc.edu
Cc: linux-scsi@vger.kernel.org, vikas.chaudhary@qlogic.com,
giridhar.malavali@qlogic.com,
Nilesh Javali <nilesh.javali@qlogic.com>
Subject: [PATCH 3/6] qla4xxx: Fix memory leak for ha->saved_acb
Date: Wed, 9 Apr 2014 21:12:26 -0400 [thread overview]
Message-ID: <1397092349-25332-4-git-send-email-vikas.chaudhary@qlogic.com> (raw)
In-Reply-To: <1397092349-25332-1-git-send-email-vikas.chaudhary@qlogic.com>
From: Nilesh Javali <nilesh.javali@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
drivers/scsi/qla4xxx/ql4_mbx.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
index 1345c0e..0a3312c 100644
--- a/drivers/scsi/qla4xxx/ql4_mbx.c
+++ b/drivers/scsi/qla4xxx/ql4_mbx.c
@@ -2395,8 +2395,6 @@ int qla4_84xx_config_acb(struct scsi_qla_host *ha, int acb_config)
}
memcpy(acb, ha->saved_acb, acb_len);
- kfree(ha->saved_acb);
- ha->saved_acb = NULL;
rval = qla4xxx_set_acb(ha, &mbox_cmd[0], &mbox_sts[0], acb_dma);
if (rval != QLA_SUCCESS)
@@ -2412,6 +2410,10 @@ exit_free_acb:
dma_free_coherent(&ha->pdev->dev, sizeof(struct addr_ctrl_blk), acb,
acb_dma);
exit_config_acb:
+ if ((acb_config == ACB_CONFIG_SET) && ha->saved_acb) {
+ kfree(ha->saved_acb);
+ ha->saved_acb = NULL;
+ }
DEBUG2(ql4_printk(KERN_INFO, ha,
"%s %s\n", __func__,
rval == QLA_SUCCESS ? "SUCCEEDED" : "FAILED"));
--
1.8.2.GIT
next prev parent reply other threads:[~2014-04-10 1:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-10 1:12 [PATCH 0/6] qla4xxx: 5.04.00-k6: Updates for scsi "misc" branch vikas.chaudhary
2014-04-10 1:12 ` [PATCH 1/6] qla4xxx: Disable INTx interrupt for ISP82XX vikas.chaudhary
2014-04-10 1:12 ` [PATCH 2/6] qla4xxx: Export sysfs DDBs from DPC handler vikas.chaudhary
2014-04-10 1:12 ` vikas.chaudhary [this message]
2014-04-10 1:12 ` [PATCH 4/6] qla4xxx: Fix smatch warning in func qla4xxx_get_ep_param vikas.chaudhary
2014-04-10 1:12 ` [PATCH 5/6] qla4xxx: Fix smatch warning in func qla4xxx_conn_get_param vikas.chaudhary
2014-04-10 1:12 ` [PATCH 6/6] qla4xxx: Update driver version to 5.04.00-k6 vikas.chaudhary
2014-04-11 17:31 ` [PATCH 0/6] qla4xxx: 5.04.00-k6: Updates for scsi "misc" branch Mike Christie
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=1397092349-25332-4-git-send-email-vikas.chaudhary@qlogic.com \
--to=vikas.chaudhary@qlogic.com \
--cc=giridhar.malavali@qlogic.com \
--cc=jbottomley@parallels.com \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
--cc=nilesh.javali@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;
as well as URLs for NNTP newsgroup(s).