OSDN Git Service

arch/sh: Check for kprobe trap number before trying to handle a kprobe trap
[uclinux-h8/linux.git] / arch / sh / kernel / kprobes.c
index 1f8c0d3..318296f 100644 (file)
@@ -485,7 +485,8 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
        struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
 
        addr = (kprobe_opcode_t *) (args->regs->pc);
-       if (val == DIE_TRAP) {
+       if (val == DIE_TRAP &&
+           args->trapnr == (BREAKPOINT_INSTRUCTION & 0xff)) {
                if (!kprobe_running()) {
                        if (kprobe_handler(args->regs)) {
                                ret = NOTIFY_STOP;