* [PATCH V2 3/4] be2iscsi : Fix memory leak in the unload path
@ 2014-12-20 0:53 John Soni Jose
2015-02-28 21:13 ` Mike Christie
0 siblings, 1 reply; 3+ messages in thread
From: John Soni Jose @ 2014-12-20 0:53 UTC (permalink / raw)
To: linux-scsi, michaelc; +Cc: John Soni Jose, Jayamohan Kallickal
Driver was not freeing the DMA memory allocated for EQ/CQ in the
unload path. This patch frees the DMA memory during the driver unload.
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
---
drivers/scsi/be2iscsi/be_main.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 2f5eb9c..93c4d07 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -3748,8 +3748,10 @@ static void hwi_cleanup(struct beiscsi_hba *phba)
for (i = 0; i < (phba->num_cpus); i++) {
q = &phwi_context->be_cq[i];
- if (q->created)
+ if (q->created) {
+ be_queue_free(phba, q);
beiscsi_cmd_q_destroy(ctrl, q, QTYPE_CQ);
+ }
}
be_mcc_queues_destroy(phba);
@@ -3759,8 +3761,10 @@ static void hwi_cleanup(struct beiscsi_hba *phba)
eq_for_mcc = 0;
for (i = 0; i < (phba->num_cpus + eq_for_mcc); i++) {
q = &phwi_context->be_eq[i].q;
- if (q->created)
+ if (q->created) {
+ be_queue_free(phba, q);
beiscsi_cmd_q_destroy(ctrl, q, QTYPE_EQ);
+ }
}
be_cmd_fw_uninit(ctrl);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH V2 3/4] be2iscsi : Fix memory leak in the unload path
2014-12-20 0:53 [PATCH V2 3/4] be2iscsi : Fix memory leak in the unload path John Soni Jose
@ 2015-02-28 21:13 ` Mike Christie
2015-03-04 7:26 ` Sony John-N
0 siblings, 1 reply; 3+ messages in thread
From: Mike Christie @ 2015-02-28 21:13 UTC (permalink / raw)
To: John Soni Jose, linux-scsi; +Cc: Jayamohan Kallickal
On 12/19/14, 6:53 PM, John Soni Jose wrote:
> Driver was not freeing the DMA memory allocated for EQ/CQ in the
> unload path. This patch frees the DMA memory during the driver unload.
>
> Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> ---
> drivers/scsi/be2iscsi/be_main.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
> index 2f5eb9c..93c4d07 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -3748,8 +3748,10 @@ static void hwi_cleanup(struct beiscsi_hba *phba)
>
> for (i = 0; i < (phba->num_cpus); i++) {
> q = &phwi_context->be_cq[i];
> - if (q->created)
> + if (q->created) {
> + be_queue_free(phba, q);
> beiscsi_cmd_q_destroy(ctrl, q, QTYPE_CQ);
> + }
> }
>
> be_mcc_queues_destroy(phba);
> @@ -3759,8 +3761,10 @@ static void hwi_cleanup(struct beiscsi_hba *phba)
> eq_for_mcc = 0;
> for (i = 0; i < (phba->num_cpus + eq_for_mcc); i++) {
> q = &phwi_context->be_eq[i].q;
> - if (q->created)
> + if (q->created) {
> + be_queue_free(phba, q);
> beiscsi_cmd_q_destroy(ctrl, q, QTYPE_EQ);
> + }
> }
> be_cmd_fw_uninit(ctrl);
> }
>
Why in this patch do you only call be_queue_free if q->created is set,
but in be_mcc_queues_destroy you do not.
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: [PATCH V2 3/4] be2iscsi : Fix memory leak in the unload path
2015-02-28 21:13 ` Mike Christie
@ 2015-03-04 7:26 ` Sony John-N
0 siblings, 0 replies; 3+ messages in thread
From: Sony John-N @ 2015-03-04 7:26 UTC (permalink / raw)
To: Mike Christie, linux-scsi@vger.kernel.org; +Cc: Jayamohan Kallickal
-----Original Message-----
From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Mike Christie
Sent: Sunday, March 01, 2015 2:43 AM
To: Sony John-N; linux-scsi@vger.kernel.org
Cc: Jayamohan Kallickal
Subject: Re: [PATCH V2 3/4] be2iscsi : Fix memory leak in the unload path
On 12/19/14, 6:53 PM, John Soni Jose wrote:
> Driver was not freeing the DMA memory allocated for EQ/CQ in the
> unload path. This patch frees the DMA memory during the driver unload.
>
> Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> ---
> drivers/scsi/be2iscsi/be_main.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/be2iscsi/be_main.c
> b/drivers/scsi/be2iscsi/be_main.c index 2f5eb9c..93c4d07 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -3748,8 +3748,10 @@ static void hwi_cleanup(struct beiscsi_hba
> *phba)
>
> for (i = 0; i < (phba->num_cpus); i++) {
> q = &phwi_context->be_cq[i];
> - if (q->created)
> + if (q->created) {
> + be_queue_free(phba, q);
> beiscsi_cmd_q_destroy(ctrl, q, QTYPE_CQ);
> + }
> }
>
> be_mcc_queues_destroy(phba);
> @@ -3759,8 +3761,10 @@ static void hwi_cleanup(struct beiscsi_hba *phba)
> eq_for_mcc = 0;
> for (i = 0; i < (phba->num_cpus + eq_for_mcc); i++) {
> q = &phwi_context->be_eq[i].q;
> - if (q->created)
> + if (q->created) {
> + be_queue_free(phba, q);
> beiscsi_cmd_q_destroy(ctrl, q, QTYPE_EQ);
> + }
> }
> be_cmd_fw_uninit(ctrl);
> }
>
> Why in this patch do you only call be_queue_free if q->created is set, but in be_mcc_queues_destroy you do not.
We missed doing the changes in be_mcc_queues_destroy(). We will fix this in the next-patchset release.
--
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-04 7:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-20 0:53 [PATCH V2 3/4] be2iscsi : Fix memory leak in the unload path John Soni Jose
2015-02-28 21:13 ` Mike Christie
2015-03-04 7:26 ` Sony John-N
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox