]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: fix anon_dev leak in create_subvol()
authorOmar Sandoval <osandov@fb.com>
Thu, 10 Mar 2022 01:31:33 +0000 (17:31 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 May 2022 15:03:06 +0000 (17:03 +0200)
commite603e7b4b352b4e8e8254c23791eed8086db2892
treec2465ec67775d7955c2307aff4ea96bc473014fb
parent3a61157569fc37fb895ef5b548165bd38a0f47c5
btrfs: fix anon_dev leak in create_subvol()

When btrfs_qgroup_inherit(), btrfs_alloc_tree_block, or
btrfs_insert_root() fail in create_subvol(), we return without freeing
anon_dev. Reorganize the error handling in create_subvol() to fix this.

Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c