]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
arm64/kernel/probes: Use BUG_ON instead of if condition followed by BUG.
authorzhouchuangao <zhouchuangao@vivo.com>
Tue, 30 Mar 2021 11:57:50 +0000 (04:57 -0700)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 13 Apr 2021 16:52:40 +0000 (17:52 +0100)
It can be optimized at compile time.

Signed-off-by: zhouchuangao <zhouchuangao@vivo.com>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Link: https://lore.kernel.org/r/1617105472-6081-1-git-send-email-zhouchuangao@vivo.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/probes/kprobes.c

index 66aac2881ba84ea06b2318b45f42919982c31c98..ecf0f613327f4b94c4402955d6bdc5d139a40ad3 100644 (file)
@@ -264,8 +264,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr)
                 * normal page fault.
                 */
                instruction_pointer_set(regs, (unsigned long) cur->addr);
-               if (!instruction_pointer(regs))
-                       BUG();
+               BUG_ON(!instruction_pointer(regs));
 
                if (kcb->kprobe_status == KPROBE_REENTER)
                        restore_previous_kprobe(kcb);