From: Dan Carpenter Date: Wed, 23 Jun 2010 17:03:01 +0000 (+0200) Subject: i915: return -EFAULT if copy_to_user fails X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c877cdce93a44eea96f6cf7fc04be7d0372db2be;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git i915: return -EFAULT if copy_to_user fails copy_to_user() returns the number of bytes remaining to be copied and I'm pretty sure we want to return a negative error code here. Signed-off-by: Dan Carpenter Signed-off-by: Chris Wilson Cc: stable@kernel.org --- diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 68526f467c87..748c26340c35 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -3588,6 +3588,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, if (ret != 0) { DRM_ERROR("copy %d cliprects failed: %d\n", args->num_cliprects, ret); + ret = -EFAULT; goto pre_mutex_err; } }