Skip to content

Commit

Permalink
arch/csky/kernel/probes/kprobes.c: fix bugon.cocci warnings
Browse files Browse the repository at this point in the history
Use BUG_ON instead of a if condition followed by BUG.

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

Link: https://lkml.kernel.org/r/alpine.DEB.2.22.394.2107061049150.7197@hadrien
Fixes: 7d37cb2 ("lib: fix kconfig dependency on ARCH_WANT_FRAME_POINTERS")
Signed-off-by: kernel test robot <[email protected]>
Signed-off-by: Julia Lawall <[email protected]>
Reported-by: kernel test robot <[email protected]>
Cc: Julian Braha <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
intel-lab-lkp authored and torvalds committed Sep 3, 2021
1 parent 9673e00 commit 4bdffd2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/csky/kernel/probes/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int trapnr)
* normal page fault.
*/
regs->pc = (unsigned long) cur->addr;
if (!instruction_pointer(regs))
BUG();
BUG_ON(!instruction_pointer(regs));

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

0 comments on commit 4bdffd2

Please sign in to comment.