Skip to content

Commit 6e9070d

Browse files
intel-lab-lkppalmer-dabbelt
authored andcommitted
riscv: fix bugon.cocci warnings
Use BUG_ON instead of a if condition followed by BUG. Generated by: scripts/coccinelle/misc/bugon.cocci Fixes: c22b0bc ("riscv: Add kprobes supported") CC: Guo Ren <[email protected]> Reported-by: kernel test robot <[email protected]> Signed-off-by: kernel test robot <[email protected]> Signed-off-by: Julia Lawall <[email protected]> Reviewed-by: Pekka Enberg <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 0d7588a commit 6e9070d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/riscv/kernel/probes/kprobes.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int trapnr)
256256
* normal page fault.
257257
*/
258258
regs->epc = (unsigned long) cur->addr;
259-
if (!instruction_pointer(regs))
260-
BUG();
259+
BUG_ON(!instruction_pointer(regs));
261260

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

0 commit comments

Comments
 (0)