From: Dmitry Kovalenko Date: Mon, 8 Apr 2013 06:25:35 +0000 (+0400) Subject: [FIX] removing probes from list if we can't handle it X-Git-Tag: Tizen_SDK_2.3~309^2~21^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=853b0aa2151f4ded2482e54f6485c0acb85df4b6;p=kernel%2Fswap-modules.git [FIX] removing probes from list if we can't handle it --- diff --git a/driver/us_proc_inst.c b/driver/us_proc_inst.c index ab2adbd..c651d50 100644 --- a/driver/us_proc_inst.c +++ b/driver/us_proc_inst.c @@ -665,7 +665,7 @@ static int register_us_page_probe(struct sspt_page *page, struct task_struct *task) { int err = 0; - struct us_ip *ip; + struct us_ip *ip, *n; spin_lock(&page->lock); @@ -679,20 +679,21 @@ static int register_us_page_probe(struct sspt_page *page, sspt_page_assert_install(page); sspt_set_all_ip_addr(page, file); - list_for_each_entry(ip, &page->ip_list, list) { + list_for_each_entry_safe(ip, n, &page->ip_list, list) { err = register_usprobe_my(task, ip); - if (err != 0) { - //TODO: ERROR - goto unlock; + if (err == -ENOEXEC) { + list_del(&ip->list); + free_ip(ip); + continue; + } else if (err) { + EPRINTF("Failed to install probe"); } } - - sspt_page_installed(page); - unlock: + sspt_page_installed(page); spin_unlock(&page->lock); - return err; + return 0; } static int unregister_us_page_probe(struct task_struct *task, diff --git a/kprobe/arch/asm-arm/dbi_kprobes.c b/kprobe/arch/asm-arm/dbi_kprobes.c index 8544cee..ce0dc37 100644 --- a/kprobe/arch/asm-arm/dbi_kprobes.c +++ b/kprobe/arch/asm-arm/dbi_kprobes.c @@ -668,8 +668,6 @@ int arch_prepare_uprobe (struct kprobe *p, struct task_struct *task, int atomic) if ((p->safe_arm == -1) && (p->safe_thumb == -1)) { printk("Error in %s at %d: failed arch_copy_trampoline_*_uprobe() (both) [tgid=%u, addr=%lx, data=%lx]\n", __FILE__, __LINE__, task->tgid, (unsigned long)p->addr, (unsigned long)p->opcode); - if (!write_proc_vm_atomic (task, (unsigned long) p->addr, &p->opcode, sizeof (p->opcode))) - panic ("Failed to write memory %p!\n", p->addr); free_insn_slot(&uprobe_insn_pages, task, p->ainsn.insn_arm); free_insn_slot(&uprobe_insn_pages, task, p->ainsn.insn_thumb); return -ENOEXEC;