linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Ian Kent <ikent@redhat.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>,
	Josef Bacik <josef@redhat.com>
Subject: Re: [PATCH] btrfs - fix memory leak on finding existing super
Date: Wed, 01 Dec 2010 09:21:02 +0800	[thread overview]
Message-ID: <4CF5A2FE.8030205@cn.fujitsu.com> (raw)
In-Reply-To: <20101130133103.4661.35881.stgit@perseus.themaw.net>

21:31, Ian Kent wrote:
> From: Ian Kent <raven@themaw.net>
> 
> We missed a memory deallocation in commit 450ba0ea.
> 
> If an existing super block is found at mount and there is no
> error condition then the pre-allocated tree_root and fs_info
> are no not used and are not freeded.
> 
> Signed-off-by: Ian Kent <raven@themaw.net>

Reviewed-by: Li Zefan <lizf@cn.fujitsu.com>

> ---
> 
>  fs/btrfs/super.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 47bf67c..f5cca1b 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -654,6 +654,8 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
>  		}
>  
>  		btrfs_close_devices(fs_devices);
> +		kfree(fs_info);
> +		kfree(tree_root);
>  	} else {
>  		char b[BDEVNAME_SIZE];
>  

      parent reply	other threads:[~2010-12-01  1:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30 13:31 [PATCH] btrfs - fix memory leak on finding existing super Ian Kent
2010-11-30 13:44 ` Ian Kent
2010-12-01  1:21 ` Li Zefan [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=4CF5A2FE.8030205@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=ikent@redhat.com \
    --cc=josef@redhat.com \
    --cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).