|
@@ -4641,7 +4641,7 @@ locked:
|
|
|
|
|
|
if (bctl->flags & ~(BTRFS_BALANCE_ARGS_MASK | BTRFS_BALANCE_TYPE_MASK)) {
|
|
if (bctl->flags & ~(BTRFS_BALANCE_ARGS_MASK | BTRFS_BALANCE_TYPE_MASK)) {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
- goto out_bargs;
|
|
|
|
|
|
+ goto out_bctl;
|
|
}
|
|
}
|
|
|
|
|
|
do_balance:
|
|
do_balance:
|
|
@@ -4655,12 +4655,15 @@ do_balance:
|
|
need_unlock = false;
|
|
need_unlock = false;
|
|
|
|
|
|
ret = btrfs_balance(bctl, bargs);
|
|
ret = btrfs_balance(bctl, bargs);
|
|
|
|
+ bctl = NULL;
|
|
|
|
|
|
if (arg) {
|
|
if (arg) {
|
|
if (copy_to_user(arg, bargs, sizeof(*bargs)))
|
|
if (copy_to_user(arg, bargs, sizeof(*bargs)))
|
|
ret = -EFAULT;
|
|
ret = -EFAULT;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+out_bctl:
|
|
|
|
+ kfree(bctl);
|
|
out_bargs:
|
|
out_bargs:
|
|
kfree(bargs);
|
|
kfree(bargs);
|
|
out_unlock:
|
|
out_unlock:
|