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: Peter 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: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
parent
67a0514afd
commit
8f4faed01e
|
@ -1667,6 +1667,7 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb)
|
|||
len)) {
|
||||
end_user:
|
||||
user_access_end();
|
||||
end:
|
||||
kvfree(relocs);
|
||||
err = -EFAULT;
|
||||
goto err;
|
||||
|
@ -1686,7 +1687,7 @@ static int eb_copy_relocations(const struct i915_execbuffer *eb)
|
|||
* relocations were valid.
|
||||
*/
|
||||
if (!user_access_begin(urelocs, size))
|
||||
goto end_user;
|
||||
goto end;
|
||||
|
||||
for (copied = 0; copied < nreloc; copied++)
|
||||
unsafe_put_user(-1,
|
||||
|
@ -2695,7 +2696,7 @@ i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data,
|
|||
* when we did the "copy_from_user()" above.
|
||||
*/
|
||||
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++) {
|
||||
if (!(exec2_list[i].offset & UPDATE))
|
||||
|
@ -2709,6 +2710,7 @@ i915_gem_execbuffer2_ioctl(struct drm_device *dev, void *data,
|
|||
}
|
||||
end_user:
|
||||
user_access_end();
|
||||
end:;
|
||||
}
|
||||
|
||||
args->flags &= ~__I915_EXEC_UNKNOWN_FLAGS;
|
||||
|
|
Loading…
Reference in New Issue