diff options
-rw-r--r-- | drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c index 3753b9661f32..9f8c32c93d82 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -3590,16 +3590,11 @@ i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data, err = i915_gem_do_execbuffer(dev, file, args, exec2_list); - /* - * Now that we have begun execution of the batchbuffer, we ignore - * any new error after this point. Also given that we have already - * updated the associated relocations, we try to write out the current - * object locations irrespective of any error. - */ if (args->flags & __EXEC_HAS_RELOC) { struct drm_i915_gem_exec_object2 __user *user_exec_list = u64_to_user_ptr(args->buffers_ptr); unsigned int i; + bool failed = true; /* Copy the new buffer offsets back to the user's exec list. */ /* @@ -3623,9 +3618,12 @@ i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data, &user_exec_list[i].offset, end_user); } + failed = false; end_user: user_write_access_end(); -end:; +end: + if (failed) + err = -EFAULT; } args->flags &= ~__I915_EXEC_UNKNOWN_FLAGS; |