[Intel-gfx] [PATCH] drm/i915: Annotate user relocs with __user

Ville Syrjälä ville.syrjala at linux.intel.com
Tue Sep 5 18:25:00 UTC 2017


On Fri, Sep 01, 2017 at 07:54:34PM +0300, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Add the missing __user to the urelocs cast to fix the following sparse
> warning:
> i915_gem_execbuffer.c:1541:47: warning: cast removes address space of expression
> i915_gem_execbuffer.c:1541:62: warning: incorrect type in argument 2 (different address spaces)
> i915_gem_execbuffer.c:1541:62:    expected void const [noderef] <asn:1>*from
> i915_gem_execbuffer.c:1541:62:    got char *
> 
> Cc: Chris Wilson <chris at chris-wilson.co.uk
> Fixes: 2889caa92321 ("drm/i915: Eliminate lots of iterations over the execobjects array")
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Pushed to dinq with Maarten's irq r-b

20:18 < vsyrjala> some care to r-b https://patchwork.freedesktop.org/patch/174831/ ?
...
20:39 < mlankhorst> irc r-b
20:48 < mlankhorst> vsyrjala: ^

> ---
>  drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> index 8a9d37ac16d4..96f7fa983cbc 100644
> --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -1538,7 +1538,7 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb)
>  				min_t(u64, BIT_ULL(31), size - copied);
>  
>  			if (__copy_from_user((char *)relocs + copied,
> -					     (char *)urelocs + copied,
> +					     (char __user *)urelocs + copied,
>  					     len)) {
>  				kvfree(relocs);
>  				err = -EFAULT;
> -- 
> 2.13.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC


More information about the Intel-gfx mailing list