[REFACTOR] redesign uprobe_handler()
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 2 Apr 2013 13:07:39 +0000 (17:07 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 2 Apr 2013 13:07:39 +0000 (17:07 +0400)
uprobe/arch/asm-arm/swap_uprobes.c

index 08b4774..eb4a5f6 100644 (file)
@@ -714,18 +714,14 @@ static int uprobe_handler(struct pt_regs *regs)
                }
 
                trampoline_uprobe_handler(p, regs);
-               return 0;
-       }
-
-       if (p && (check_validity_insn(p, regs) != 0)) {
+       } else if (check_validity_insn(p, regs) != 0) {
                printk("no_uprobe live\n");
-               return 0;
-       }
-
-       restore_opcode_for_thumb(p, regs);
+       } else {
+               restore_opcode_for_thumb(p, regs);
 
-       if (!p->pre_handler || !p->pre_handler(p, regs)) {
-               prepare_singlestep(p, regs);
+               if (!p->pre_handler || !p->pre_handler(p, regs)) {
+                       prepare_singlestep(p, regs);
+               }
        }
 
        return 0;