Commit 8f4faed0 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

i915, uaccess: Fix redundant CLAC

New tooling noticed this:

 drivers/gpu/drm/i915/i915_gem_execbuffer.o: warning: objtool: .altinstr_replacement+0x3c: redundant UACCESS disable
 drivers/gpu/drm/i915/i915_gem_execbuffer.o: warning: objtool: .altinstr_replacement+0x66: redundant UACCESS disable

You don't need user_access_end() if user_access_begin() fails.
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 67a0514a
...@@ -1667,6 +1667,7 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb) ...@@ -1667,6 +1667,7 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb)
len)) { len)) {
end_user: end_user:
user_access_end(); user_access_end();
end:
kvfree(relocs); kvfree(relocs);
err = -EFAULT; err = -EFAULT;
goto err; goto err;
...@@ -1686,7 +1687,7 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb) ...@@ -1686,7 +1687,7 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb)
* relocations were valid. * relocations were valid.
*/ */
if (!user_access_begin(urelocs, size)) if (!user_access_begin(urelocs, size))
goto end_user; goto end;
for (copied = 0; copied < nreloc; copied++) for (copied = 0; copied < nreloc; copied++)
unsafe_put_user(-1, unsafe_put_user(-1,
...@@ -2695,7 +2696,7 @@ i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data, ...@@ -2695,7 +2696,7 @@ i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data,
* when we did the "copy_from_user()" above. * when we did the "copy_from_user()" above.
*/ */
if (!user_access_begin(user_exec_list, count * sizeof(*user_exec_list))) if (!user_access_begin(user_exec_list, count * sizeof(*user_exec_list)))
goto end_user; goto end;
for (i = 0; i < args->buffer_count; i++) { for (i = 0; i < args->buffer_count; i++) {
if (!(exec2_list[i].offset & UPDATE)) if (!(exec2_list[i].offset & UPDATE))
...@@ -2709,6 +2710,7 @@ i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data, ...@@ -2709,6 +2710,7 @@ i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data,
} }
end_user: end_user:
user_access_end(); user_access_end();
end:;
} }
args->flags &= ~__I915_EXEC_UNKNOWN_FLAGS; args->flags &= ~__I915_EXEC_UNKNOWN_FLAGS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment