Re: [PATCH 6/6] drm/i915: Support for capturing MMIO register values

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

 



On Thu, Mar 16, 2017 at 11:50:11AM +0530, sourab.gupta@xxxxxxxxx wrote:
> +static int copy_mmio_list(struct drm_i915_private *dev_priv,
> +				void __user *mmio)
> +{
> +	void __user *mmio_list = ((u8 __user *)mmio + 4);
> +	u32 num_mmio;
> +	int ret;
> +
> +	if (!mmio)
> +		return -EINVAL;
> +
> +	ret = get_user(num_mmio, (u32 __user *)mmio);
> +	if (ret)
> +		return ret;
> +
> +	if (num_mmio > I915_PERF_MMIO_NUM_MAX)
> +		return -EINVAL;
> +
> +	memset(dev_priv->perf.mmio_list, 0, I915_PERF_MMIO_NUM_MAX);
> +	if (copy_from_user(dev_priv->perf.mmio_list, mmio_list, 4*num_mmio))

return -EFAULT;

check all the others (copy_from_user and copy_to_user).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux