Messages in this thread Patch in this message | | | From | Amit Daniel Kachhap <> | Subject | [PATCH] arm64/traps: Avoid unnecessary kernel/user pointer conversion | Date | Tue, 14 Sep 2021 20:57:42 +0530 |
| |
Annotating a pointer from kernel to __user and then back again might confuse sparse. In call_undef_hook() it can be avoided by not using the intermediate user pointer variable.
Note: This patch adds no functional changes to code.
Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com> --- arch/arm64/kernel/traps.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index b03e383d944a..357d10a8bbf5 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -404,7 +404,8 @@ static int call_undef_hook(struct pt_regs *regs) if (!user_mode(regs)) { __le32 instr_le; - if (get_kernel_nofault(instr_le, (__force __le32 *)pc)) + if (get_kernel_nofault(instr_le, + (__le32 *)instruction_pointer(regs))) goto exit; instr = le32_to_cpu(instr_le); } else if (compat_thumb_mode(regs)) { -- 2.17.1
| |