Re: [PATCH 8/9] VC04_SERVICES: Add compat ioctl handler for "get config"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux