fork: Use RCU_INIT_POINTER() instead of rcu_access_pointer()

Use RCU_INIT_POINTER() instead of rcu_access_pointer() in
copy_sighand().

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
[christian.brauner@ubuntu.com: edit commit message]
Link: https://lore.kernel.org/r/20200127175821.10833-1-madhuparnabhowmik10@gmail.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Madhuparna Bhowmik 2020-01-27 23:28:21 +05:30 committed by Christian Brauner
parent bb6d3fb354
commit 0c282b068e
No known key found for this signature in database
GPG key ID: 91C61BC06578DCA2

View file

@ -1508,7 +1508,7 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
return 0;
}
sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL);
rcu_assign_pointer(tsk->sighand, sig);
RCU_INIT_POINTER(tsk->sighand, sig);
if (!sig)
return -ENOMEM;