On Wed, Jan 30, 2013 at 02:43:41PM -0800, Mark Fasheh wrote:
> @@ -4570,6 +4605,11 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
> INIT_RADIX_TREE(&sctx->name_cache, GFP_NOFS);
> INIT_LIST_HEAD(&sctx->name_cache_list);
>
> + if (arg->flags & ~BTRFS_SEND_FLAG_NO_FILE_DATA)
> + return -EINVAL;
Doing just return skips the cleanup block (goto out;), also the test can
be placed just after the access_ok() call and skip allocation and init
of sctx.
> +
> + sctx->flags = arg->flags;
> +
> sctx->send_filp = fget(arg->send_fd);
> if (IS_ERR(sctx->send_filp)) {
> ret = PTR_ERR(sctx->send_filp);
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html