ath10k: fix parenthesis alignment warning in ath10k_htt_rx_alloc()
[cascardo/linux.git] / kernel / nsproxy.c
index 8e78110..ef42d0a 100644 (file)
@@ -204,20 +204,13 @@ void switch_task_namespaces(struct task_struct *p, struct nsproxy *new)
 
        might_sleep();
 
+       task_lock(p);
        ns = p->nsproxy;
+       p->nsproxy = new;
+       task_unlock(p);
 
-       rcu_assign_pointer(p->nsproxy, new);
-
-       if (ns && atomic_dec_and_test(&ns->count)) {
-               /*
-                * wait for others to get what they want from this nsproxy.
-                *
-                * cannot release this nsproxy via the call_rcu() since
-                * put_mnt_ns() will want to sleep
-                */
-               synchronize_rcu();
+       if (ns && atomic_dec_and_test(&ns->count))
                free_nsproxy(ns);
-       }
 }
 
 void exit_task_namespaces(struct task_struct *p)