From: Ian Kent Date: Mon, 27 Dec 2010 08:33:15 +0000 (+0800) Subject: Btrfs: Fix memory leak on finding existing super X-Git-Tag: Ubuntu-5.13.0-19.19~28681^2~21^2~4 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=bdc924bb4cdac92b945945c3149ab8191c92d75d;p=mirror_ubuntu-jammy-kernel.git 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 Signed-off-by: Li Zefan --- diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 61bd79abb805..f50253c2279d 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];