From 4c2b75656294b437979b95a9c26416077e666774 Mon Sep 17 00:00:00 2001 From: Alexander Aksenov Date: Fri, 7 Mar 2014 14:51:41 +0400 Subject: [PATCH] [FIX] Uprobe: add kprobe struct fields init Change-Id: I1e39ac2da426c1ef264dc335ef2a85374ed6c922 Signed-off-by: Alexander Aksenov --- uprobe/swap_uprobes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/uprobe/swap_uprobes.c b/uprobe/swap_uprobes.c index b307668..9eb2036 100644 --- a/uprobe/swap_uprobes.c +++ b/uprobe/swap_uprobes.c @@ -294,7 +294,6 @@ struct kprobe *get_ukprobe(void *addr, pid_t tgid) */ void add_uprobe_table(struct kprobe *p) { - INIT_HLIST_NODE(&p->is_hlist); hlist_add_head_rcu(&p->is_hlist, &uprobe_insn_slot_table[hash_ptr(p->ainsn.insn, UPROBE_HASH_BITS)]); } @@ -513,6 +512,8 @@ int swap_register_uprobe(struct uprobe *up) goto out; } + INIT_HLIST_NODE(&p->is_hlist); + ret = arch_prepare_uprobe(up); if (ret) { DBPRINTF("goto out\n", ret); @@ -656,6 +657,7 @@ void __swap_unregister_ujprobe(struct ujprobe *jp, int disarm) * dereference error. That is why we check whether this node * really belongs to the hlist. */ + if (!(hlist_unhashed(&jp->up.kp.is_hlist))) { hlist_del_rcu(&jp->up.kp.is_hlist); } -- 2.7.4