summaryrefslogtreecommitdiff
path: root/kprobe
diff options
context:
space:
mode:
authorAlexander Aksenov <a.aksenov@samsung.com>2014-01-29 17:18:59 +0400
committerAlexander Aksenov <a.aksenov@samsung.com>2014-01-29 17:18:59 +0400
commitfc2f3f1149e622f117124f8c62a14dba466efa92 (patch)
tree17b875e3b22c9d2c2e0be5cb6388abee273fe448 /kprobe
parentfac2cb3f0e456d0a9729d3da4a08d1d2de58cf21 (diff)
downloadswap-modules-fc2f3f1149e622f117124f8c62a14dba466efa92.tar.gz
swap-modules-fc2f3f1149e622f117124f8c62a14dba466efa92.tar.bz2
swap-modules-fc2f3f1149e622f117124f8c62a14dba466efa92.zip
[FIX] Kprobe: replace kretprobe_lock spinlocksdev/aarch64
Now all calls of dbi_unregister_kretprobe_top are inside Change-Id: I5b62df36ae5318f9cc8484d3c724fff94989c8ed Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
Diffstat (limited to 'kprobe')
-rw-r--r--kprobe/dbi_kprobes.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kprobe/dbi_kprobes.c b/kprobe/dbi_kprobes.c
index cc7bd3ba..7a9febf0 100644
--- a/kprobe/dbi_kprobes.c
+++ b/kprobe/dbi_kprobes.c
@@ -824,15 +824,11 @@ static int dbi_disarm_krp_inst(struct kretprobe_instance *ri);
static void dbi_unregister_kretprobe_top(struct kretprobe *rp)
{
- unsigned long flags;
struct kretprobe_instance *ri;
DECLARE_NODE_PTR_FOR_HLIST(node);
dbi_unregister_kprobe(&rp->kp);
- /* No race here */
- spin_lock_irqsave(&kretprobe_lock, flags);
-
swap_hlist_for_each_entry(ri, node, &rp->used_instances, uflist) {
if (!dbi_disarm_krp_inst(ri)) {
printk("%s (%d/%d): cannot disarm krp instance (%08lx)\n",
@@ -840,8 +836,6 @@ static void dbi_unregister_kretprobe_top(struct kretprobe *rp)
(unsigned long)rp->kp.addr);
}
}
-
- spin_unlock_irqrestore(&kretprobe_lock, flags);
}
static void dbi_unregister_kretprobe_bottom(struct kretprobe *rp)
@@ -865,10 +859,15 @@ static void dbi_unregister_kretprobe_bottom(struct kretprobe *rp)
void dbi_unregister_kretprobes(struct kretprobe **rpp, size_t size)
{
size_t i;
+ unsigned long flags;
+
+ spin_lock_irqsave(&kretprobe_lock, flags);
for (i = 0; i < size; i++)
dbi_unregister_kretprobe_top(rpp[i]);
+ spin_unlock_irqrestore(&kretprobe_lock, flags);
+
if (!in_atomic())
synchronize_sched();