]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Feb 2019 16:27:43 +0000 (17:27 +0100)
commitb06853ecf284f641be50334af56db1e66c5eba33
treed3f1d31f15b5912faa9e10ede230fa6900a76347
parent1300efa04447591162443447d8bf2417c5aa26fc
btrfs: On error always free subvol_name in btrfs_mount

commit 532b618bdf237250d6d4566536d4b6ce3d0a31fe upstream.

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: 312c89fbca06 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/super.c