public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <robert.w.love@intel.com>
To: Hillf Danton <dhillf@gmail.com>
Cc: devel@open-fcoe.org, linux-scsi@vger.kernel.org
Subject: Re: [Open-FCoE] [PATCH 1/2] libfc: fix memory leakage in local port
Date: Thu, 28 Oct 2010 16:12:05 -0700	[thread overview]
Message-ID: <1288307525.1431.201.camel@fritz> (raw)
In-Reply-To: <AANLkTi=dLRNj0r8aUehqtVPgzpJsbGqnX2t-7AOkQfkS@mail.gmail.com>

On Wed, 2010-10-27 at 20:40 +0800, Hillf Danton wrote:
> There seems info should get freed when error encountered.
> 
> Signed-off-by: Hillf Danton <dhillf@gmail.com>
> ---
> 
> --- a/drivers/scsi/libfc/fc_lport.c	2010-09-13 07:07:38.000000000 +0800
> +++ b/drivers/scsi/libfc/fc_lport.c	2010-10-27 20:33:36.000000000 +0800
> @@ -1766,8 +1766,10 @@ static int fc_lport_ct_request(struct fc
>  	info->sg = job->reply_payload.sg_list;
> 
>  	if (!lport->tt.exch_seq_send(lport, fp, fc_lport_bsg_resp,
> -				     NULL, info, tov))
> +				     NULL, info, tov)) {
> +		kfree(info);

We cannot free the BSG info here. If you look at fc_exch_seq_send you
can see that it's attached to the exchange and then when the response is
received it is passed to the response handler, in the case
fc_lport_bsg_resp, where it is free'd.

>  		return -ECOMM;
> +	}
>  	return 0;
>  }
> _______________________________________________
> devel mailing list
> devel@open-fcoe.org
> http://www.open-fcoe.org/mailman/listinfo/devel



  parent reply	other threads:[~2010-10-28 23:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-27 12:40 [PATCH 1/2] libfc: fix memory leakage in local port Hillf Danton
2010-10-27 12:43 ` [PATCH 2/2] " Hillf Danton
2010-10-28 23:13   ` [Open-FCoE] " Robert Love
2010-10-28 23:12 ` Robert Love [this message]
2010-10-28 23:31   ` [Open-FCoE] [PATCH 1/2] " Joe Eykholt
2010-10-28 23:35     ` Robert Love

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=1288307525.1431.201.camel@fritz \
    --to=robert.w.love@intel.com \
    --cc=devel@open-fcoe.org \
    --cc=dhillf@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    /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