public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Dr. J. Bruce Fields" <bfields@fieldses.org>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] SUNRPC: Fix a potential memory leak in auth_gss
Date: Sat, 20 Mar 2010 21:45:16 -0400	[thread overview]
Message-ID: <20100321014516.GC30408@fieldses.org> (raw)
In-Reply-To: <1269026879.10771.2.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>

On Fri, Mar 19, 2010 at 03:27:59PM -0400, Trond Myklebust wrote:
> From: Trond Myklebust <Trond.Myklebust@netapp.com>
> 
> The function alloc_enc_pages() currently fails to release the pointer
> rqstp->rq_enc_pages in the error path.

Thanks, and it's simpler, too.  For what it's worth:

	Acked-by: J. Bruce Fields <bfields@citi.umich.edu>

--b.

> 
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> ---
> 
>  net/sunrpc/auth_gss/auth_gss.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> 
> diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
> index 0cfccc2..c389ccf 100644
> --- a/net/sunrpc/auth_gss/auth_gss.c
> +++ b/net/sunrpc/auth_gss/auth_gss.c
> @@ -1280,9 +1280,8 @@ alloc_enc_pages(struct rpc_rqst *rqstp)
>  	rqstp->rq_release_snd_buf = priv_release_snd_buf;
>  	return 0;
>  out_free:
> -	for (i--; i >= 0; i--) {
> -		__free_page(rqstp->rq_enc_pages[i]);
> -	}
> +	rqstp->rq_enc_pages_num = i;
> +	priv_release_snd_buf(rqstp);
>  out:
>  	return -EAGAIN;
>  }
> 

      parent reply	other threads:[~2010-03-21  1:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19 19:27 [PATCH] SUNRPC: Fix a potential memory leak in auth_gss Trond Myklebust
     [not found] ` <1269026879.10771.2.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-03-21  1:45   ` Dr. J. Bruce Fields [this message]

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=20100321014516.GC30408@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@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