Btrfs: eliminate a use-after-free in btrfs_balance()
authorIlya Dryomov <idryomov@gmail.com>
Tue, 12 Feb 2013 16:27:46 +0000 (16:27 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Wed, 20 Feb 2013 17:59:53 +0000 (12:59 -0500)
commitbf023ecfcaf114c410759f375073e78b0871c120
tree71498b3d5181414892aaa2a0f632142724968d72
parentc8f2f24bd56a9f0bc7372e6d6aded6fc122b9120
Btrfs: eliminate a use-after-free in btrfs_balance()

Commit 5af3e8cc introduced a use-after-free at volumes.c:3139: bctl is freed
above in __cancel_balance() in all cases except for balance pause.  Fix this
by moving the offending check a couple statements above, the meaning of the
check is preserved.

Reported-by: Chris Mason <chris.mason@fusionio.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/volumes.c