Commit bdc924bb4cdac92b945945c3149ab8191c92d75d

Authored by Ian Kent
Committed by Li Zefan
1 parent 83a4d54840

Btrfs: Fix memory leak on finding existing super

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>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

... ... @@ -654,6 +654,8 @@
654 654 }
655 655  
656 656 btrfs_close_devices(fs_devices);
  657 + kfree(fs_info);
  658 + kfree(tree_root);
657 659 } else {
658 660 char b[BDEVNAME_SIZE];
659 661