aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-09-14 06:46:00 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-09-20 08:23:05 -0400
commitba7a64587bcff8d85666a70b0a515d5fbcaa000c (patch)
tree0250d7057cc4b5f4416177e36875f8019b6804b8 /drivers/gpu/drm/i915
parentd627b62ff8d4d36761adbcd90ff143d79c94ab22 (diff)
drm/i915: Drop the misleading cast to the wrong user pointer type
The exec_list is of type drm_i915_gem_exec_object2 and so casting it to a drm_i915_gem_relocation_entry is very confusing! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_execbuffer.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 4ab008397d60..8186f63474f4 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -1102,8 +1102,7 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
1102 return -ENOMEM; 1102 return -ENOMEM;
1103 } 1103 }
1104 ret = copy_from_user(exec_list, 1104 ret = copy_from_user(exec_list,
1105 (struct drm_i915_relocation_entry __user *) 1105 (void __user *)(uintptr_t)args->buffers_ptr,
1106 (uintptr_t) args->buffers_ptr,
1107 sizeof(*exec_list) * args->buffer_count); 1106 sizeof(*exec_list) * args->buffer_count);
1108 if (ret != 0) { 1107 if (ret != 0) {
1109 DRM_DEBUG("copy %d exec entries failed %d\n", 1108 DRM_DEBUG("copy %d exec entries failed %d\n",
@@ -1142,8 +1141,7 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
1142 for (i = 0; i < args->buffer_count; i++) 1141 for (i = 0; i < args->buffer_count; i++)
1143 exec_list[i].offset = exec2_list[i].offset; 1142 exec_list[i].offset = exec2_list[i].offset;
1144 /* ... and back out to userspace */ 1143 /* ... and back out to userspace */
1145 ret = copy_to_user((struct drm_i915_relocation_entry __user *) 1144 ret = copy_to_user((void __user *)(uintptr_t)args->buffers_ptr,
1146 (uintptr_t) args->buffers_ptr,
1147 exec_list, 1145 exec_list,
1148 sizeof(*exec_list) * args->buffer_count); 1146 sizeof(*exec_list) * args->buffer_count);
1149 if (ret) { 1147 if (ret) {
@@ -1197,8 +1195,7 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data,
1197 ret = i915_gem_do_execbuffer(dev, data, file, args, exec2_list); 1195 ret = i915_gem_do_execbuffer(dev, data, file, args, exec2_list);
1198 if (!ret) { 1196 if (!ret) {
1199 /* Copy the new buffer offsets back to the user's exec list. */ 1197 /* Copy the new buffer offsets back to the user's exec list. */
1200 ret = copy_to_user((struct drm_i915_relocation_entry __user *) 1198 ret = copy_to_user((void __user *)(uintptr_t)args->buffers_ptr,
1201 (uintptr_t) args->buffers_ptr,
1202 exec2_list, 1199 exec2_list,
1203 sizeof(*exec2_list) * args->buffer_count); 1200 sizeof(*exec2_list) * args->buffer_count);
1204 if (ret) { 1201 if (ret) {