Linux NFS development
 help / color / mirror / Atom feed
From: bfields <bfields@fieldses.org>
To: majianpeng <majianpeng@gmail.com>
Cc: linux-nfs <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] nfsd: Fix memleak.
Date: Tue, 29 Jan 2013 17:29:45 -0500	[thread overview]
Message-ID: <20130129222945.GB6219@fieldses.org> (raw)
In-Reply-To: <201301291315544246751@gmail.com>

On Tue, Jan 29, 2013 at 01:16:01PM +0800, majianpeng wrote:
> In func svc_export_parse,the uuid which used kmemdup to alloc will be
> changed in func export_update.So the later kfree don't free this memory.
> And it can't be free in func svc_export_parse because other place still
> used.So put this operation in func svc_export_put.

Applying, thanks.--b.

> 
> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
>  fs/nfsd/export.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index a3946cf..45159ee 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -315,6 +315,7 @@ static void svc_export_put(struct kref *ref)
>  	path_put(&exp->ex_path);
>  	auth_domain_put(exp->ex_client);
>  	nfsd4_fslocs_free(&exp->ex_fslocs);
> +	kfree(exp->ex_uuid);
>  	kfree(exp);
>  }
>  
> -- 
> 1.7.9.5

      reply	other threads:[~2013-01-29 22:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29  5:16 [PATCH 1/2] nfsd: Fix memleak majianpeng
2013-01-29 22:29 ` bfields [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=20130129222945.GB6219@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=majianpeng@gmail.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