Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[firefly-linux-kernel-4.4.55.git] / drivers / edac / edac_mc.c
index 1d8056049072698361a2eeb83db0d0a5935964e0..d69144a090435cbfdd5d883e231475e649c666d8 100644 (file)
@@ -447,20 +447,16 @@ fail1:
        return 1;
 }
 
-static void complete_mc_list_del(struct rcu_head *head)
-{
-       struct mem_ctl_info *mci;
-
-       mci = container_of(head, struct mem_ctl_info, rcu);
-       INIT_LIST_HEAD(&mci->link);
-}
-
 static void del_mc_from_global_list(struct mem_ctl_info *mci)
 {
        atomic_dec(&edac_handlers);
        list_del_rcu(&mci->link);
-       call_rcu(&mci->rcu, complete_mc_list_del);
-       rcu_barrier();
+
+       /* these are for safe removal of devices from global list while
+        * NMI handlers may be traversing list
+        */
+       synchronize_rcu();
+       INIT_LIST_HEAD(&mci->link);
 }
 
 /**