aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 55f4c060fa01..ff0d94dd3550 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2634,15 +2634,6 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
2634 2634
2635 i915_verify_inactive(dev, __FILE__, __LINE__); 2635 i915_verify_inactive(dev, __FILE__, __LINE__);
2636 2636
2637 /* Copy the new buffer offsets back to the user's exec list. */
2638 ret = copy_to_user((struct drm_i915_relocation_entry __user *)
2639 (uintptr_t) args->buffers_ptr,
2640 exec_list,
2641 sizeof(*exec_list) * args->buffer_count);
2642 if (ret)
2643 DRM_ERROR("failed to copy %d exec entries "
2644 "back to user (%d)\n",
2645 args->buffer_count, ret);
2646err: 2637err:
2647 for (i = 0; i < pinned; i++) 2638 for (i = 0; i < pinned; i++)
2648 i915_gem_object_unpin(object_list[i]); 2639 i915_gem_object_unpin(object_list[i]);
@@ -2652,6 +2643,18 @@ err:
2652 2643
2653 mutex_unlock(&dev->struct_mutex); 2644 mutex_unlock(&dev->struct_mutex);
2654 2645
2646 if (!ret) {
2647 /* Copy the new buffer offsets back to the user's exec list. */
2648 ret = copy_to_user((struct drm_i915_relocation_entry __user *)
2649 (uintptr_t) args->buffers_ptr,
2650 exec_list,
2651 sizeof(*exec_list) * args->buffer_count);
2652 if (ret)
2653 DRM_ERROR("failed to copy %d exec entries "
2654 "back to user (%d)\n",
2655 args->buffer_count, ret);
2656 }
2657
2655pre_mutex_err: 2658pre_mutex_err:
2656 drm_free(object_list, sizeof(*object_list) * args->buffer_count, 2659 drm_free(object_list, sizeof(*object_list) * args->buffer_count,
2657 DRM_MEM_DRIVER); 2660 DRM_MEM_DRIVER);