]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: On error always free subvol_name in btrfs_mount
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 30 Jan 2019 13:54:12 +0000 (07:54 -0600)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 Jan 2019 17:16:47 +0000 (18:16 +0100)
commit66968614ccc4bbbd01b14d0614b83988cf26c933
treef0dbc1ed55d132b859a62e0785cf4cd37261c64c
parenta7239b4deb0b776d191486e8db8c52bec797c7df
btrfs: On error always free subvol_name in btrfs_mount

The subvol_name is allocated in btrfs_parse_subvol_options and is
consumed and freed in mount_subvol.  Add a free to the error paths that
don't call mount_subvol so that it is guaranteed that subvol_name is
freed when an error happens.

Fixes: c726b51fca5f ("btrfs: cleanup btrfs_mount() using btrfs_mount_root()")
Cc: stable@vger.kernel.org # v4.19+
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/super.c