When we stop profiling, da_manager and profiling application may
unregister the same probe simultaneously.
Change-Id: I81d4e02fa97f27215ebf321e6c58896ec761ce2a
Signed-off-by: Anatolii Nikulin <nikulin.a@samsung.com>
static DEFINE_RWLOCK(st_lock);
static struct hlist_head slot_table[UPROBE_TABLE_SIZE];
+static DEFINE_MUTEX(up_mtx); /* Protects uprobe_table */
struct hlist_head uprobe_table[UPROBE_TABLE_SIZE];
static DEFINE_MUTEX(urp_mtx); /* Protects uretprobe_inst_table */
if (!p->task)
return;
+ mutex_lock(&up_mtx);
rcu_read_lock();
old_p = get_uprobe(p->addr, p->task->tgid);
rcu_read_unlock();
if (unlikely(!old_p))
- return;
+ goto out_unlock;
if (p != old_p) {
rcu_read_lock();
}
}
rcu_read_unlock();
-
- return;
+ goto out_unlock;
}
valid_p:
old_p->post_handler = NULL;
}
}
+
+out_unlock:
+ mutex_unlock(&up_mtx);
}
EXPORT_SYMBOL_GPL(__swap_unregister_uprobe);