Unverified Commit 6e9070dc authored by kernel test robot's avatar kernel test robot Committed by Palmer Dabbelt
Browse files

riscv: fix bugon.cocci warnings



Use BUG_ON instead of a if condition followed by BUG.

Generated by: scripts/coccinelle/misc/bugon.cocci

Fixes: c22b0bcb ("riscv: Add kprobes supported")
CC: Guo Ren <guoren@linux.alibaba.com>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarJulia Lawall <julia.lawall@inria.fr>
Reviewed-by: default avatarPekka Enberg <penberg@kernel.org>
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent 0d7588ab
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -256,8 +256,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int trapnr)
		 * normal page fault.
		 */
		regs->epc = (unsigned long) cur->addr;
		if (!instruction_pointer(regs))
			BUG();
		BUG_ON(!instruction_pointer(regs));

		if (kcb->kprobe_status == KPROBE_REENTER)
			restore_previous_kprobe(kcb);