From: Madhuparna Bhowmik Date: Thu, 30 Jan 2020 06:20:28 +0000 (+0530) Subject: exit: Fix Sparse errors and warnings X-Git-Tag: v5.6-rc5~14^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=22a34c6fe0ffc1d92ee26a25913fadf347258fd6;p=thirdparty%2Fkernel%2Flinux.git exit: Fix Sparse errors and warnings This patch fixes the following sparse error: kernel/exit.c:627:25: error: incompatible types in comparison expression And the following warning: kernel/exit.c:626:40: warning: incorrect type in assignment Signed-off-by: Madhuparna Bhowmik Acked-by: Oleg Nesterov Acked-by: Christian Brauner [christian.brauner@ubuntu.com: edit commit message] Link: https://lore.kernel.org/r/20200130062028.4870-1-madhuparnabhowmik10@gmail.com Signed-off-by: Christian Brauner --- diff --git a/kernel/exit.c b/kernel/exit.c index 2833ffb0c2110..0b81b26a872a0 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -619,8 +619,8 @@ static void forget_original_parent(struct task_struct *father, reaper = find_new_reaper(father, reaper); list_for_each_entry(p, &father->children, sibling) { for_each_thread(p, t) { - t->real_parent = reaper; - BUG_ON((!t->ptrace) != (t->parent == father)); + RCU_INIT_POINTER(t->real_parent, reaper); + BUG_ON((!t->ptrace) != (rcu_access_pointer(t->parent) == father)); if (likely(!t->ptrace)) t->parent = t->real_parent; if (t->pdeath_signal)