Skip to content

Commit

Permalink
Btrfs: Fix memory leak on finding existing super
Browse files Browse the repository at this point in the history
We missed a memory deallocation in commit 450ba0e.

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>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
  • Loading branch information
Ian Kent authored and Li Zefan committed Jan 26, 2011
1 parent 83a4d54 commit bdc924b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit bdc924b

Please sign in to comment.