[IMPROVE] take out swap_unregister_kprobe() from atomic context 22/69322/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 12 May 2016 11:27:16 +0000 (14:27 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 17 May 2016 17:03:11 +0000 (20:03 +0300)
Change-Id: I3f00340f2a45dc08f3909451c417d744b22be673
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
kprobe/swap_kprobes.c

index 2c3e934..ff6c163 100644 (file)
@@ -994,7 +994,6 @@ static int __swap_unregister_kretprobes_top(void *data)
        const size_t end = ((size_t) 0) - 1;
 
        for (--size; size != end; --size) {
-               swap_unregister_kprobe(&rps[size]->kp);
                if (rp_disarm) {
                        spin_lock_irqsave(&kretprobe_lock, flags);
                        swap_disarm_krp(rps[size]);
@@ -1021,6 +1020,10 @@ void swap_unregister_kretprobes_top(struct kretprobe **rps, size_t size,
                .size = size,
                .rp_disarm = rp_disarm,
        };
+       const size_t end = ((size_t)0) - 1;
+
+       for (--size; size != end; --size)
+               swap_unregister_kprobe(&rps[size]->kp);
 
        if (rp_disarm) {
                int ret;