public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: John Soni Jose <sony.john-n@emulex.com>, linux-scsi@vger.kernel.org
Cc: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Subject: Re: [PATCH V2 3/4] be2iscsi : Fix memory leak in the unload path
Date: Sat, 28 Feb 2015 15:13:12 -0600	[thread overview]
Message-ID: <54F22F68.4010502@cs.wisc.edu> (raw)
In-Reply-To: <c943192d-954f-4f3a-bb3a-ca527164c9a0@CMEXHTCAS1.ad.emulex.com>

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.

  reply	other threads:[~2015-02-28 21:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2015-03-04  7:26   ` Sony John-N

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=54F22F68.4010502@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=jayamohan.kallickal@emulex.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sony.john-n@emulex.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