From: Masami Hiramatsu Date: Thu, 31 Mar 2022 01:11:17 +0000 (+0900) Subject: rethook: Fix to use WRITE_ONCE() for rethook:: Handler X-Git-Tag: v6.1-rc5~1602^2~1^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2fb49833cad07a53651c23dce508127085fae2d;p=platform%2Fkernel%2Flinux-starfive.git rethook: Fix to use WRITE_ONCE() for rethook:: Handler Since the function pointered by rethook::handler never be removed when the rethook is alive, it doesn't need to use rcu_assign_pointer() to update it. Just use WRITE_ONCE(). Reported-by: Alexei Starovoitov Signed-off-by: Masami Hiramatsu Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/164868907688.21983.1606862921419988152.stgit@devnote2 --- diff --git a/kernel/trace/rethook.c b/kernel/trace/rethook.c index ab463a4..b568337 100644 --- a/kernel/trace/rethook.c +++ b/kernel/trace/rethook.c @@ -65,7 +65,7 @@ static void rethook_free_rcu(struct rcu_head *head) */ void rethook_free(struct rethook *rh) { - rcu_assign_pointer(rh->handler, NULL); + WRITE_ONCE(rh->handler, NULL); call_rcu(&rh->rcu, rethook_free_rcu); }