[PATCH 8/9] VC04_SERVICES: Add compat ioctl handler for "get config"
Dan Carpenter
dan.carpenter at oracle.com
Thu Jan 19 02:28:47 PST 2017
On Wed, Jan 18, 2017 at 07:04:52AM -0800, Michael Zoran wrote:
> +
> + status = vchiq_get_config(instance, args.config_size, &config);
> +
> + if (status == VCHIQ_SUCCESS) {
> + if (copy_to_user((void __user *)args.pconfig,
> + &config,
> + args.config_size)) {
> + ret = -EFAULT;
> + break;
> + }
> + }
if vchiq_get_config() fails, we should return a failure. It's sort of
a mess, yes, because it can't fail and because it's returning custom
error codes.
But anyway:
if (status != VCHIQ_SUCCESS)
return -EINVAL;
if (copy_to_user((void __user *)args.pconfig, ...
regards,
dan carpenter
More information about the linux-rpi-kernel
mailing list