[FIX] Kprobe: remove aggrigated probe from list 56/22656/3
authorAlexander Aksenov <a.aksenov@samsung.com>
Mon, 9 Jun 2014 10:58:02 +0000 (14:58 +0400)
committerDmitry Kovalenko <d.kovalenko@samsung.com>
Wed, 25 Jun 2014 12:09:54 +0000 (05:09 -0700)
Change-Id: I2345b00e0e7f04cf4ac26e9fd3217be983e8d8b0
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
kprobe/swap_kprobes.c

index c8f2baf..95bdbe5 100644 (file)
@@ -557,8 +557,10 @@ static void swap_unregister_valid_kprobe(struct kprobe *p, struct kprobe *old_p)
                swap_arch_disarm_kprobe(p);
                hlist_del_rcu(&old_p->hlist);
 
-               if (p != old_p)
+               if (p != old_p) {
+                       list_del_rcu(&old_p->list);
                        kfree(old_p);
+               }
                /* Synchronize and remove probe in bottom */
        } else {
                list_del_rcu(&p->list);
@@ -589,11 +591,12 @@ void swap_unregister_kprobe(struct kprobe *kp)
        if (kp != old_p) {
                list_for_each_entry_rcu(list_p, &old_p->list, list)
                        if (list_p == kp)
-                               /* kprobe p is a valid probe */
-                               swap_unregister_valid_kprobe(kp, old_p);
+                               goto unreg_valid_kprobe;
+               /* kprobe invalid */
                return;
        }
 
+unreg_valid_kprobe:
        swap_unregister_valid_kprobe(kp, old_p);
 }
 EXPORT_SYMBOL_GPL(swap_unregister_kprobe);