diff options
author | 2022-03-31 10:11:17 +0900 | |
---|---|---|
committer | 2022-03-30 19:28:17 -0700 | |
commit | a2fb49833cad07a53651c23dce508127085fae2d (patch) | |
tree | da532f8277b15f581506b106a8159db0a10eb609 /kernel/trace | |
parent | selftests/bpf: Fix warning comparing pointer to 0 (diff) | |
download | linux-a2fb49833cad07a53651c23dce508127085fae2d.tar.gz linux-a2fb49833cad07a53651c23dce508127085fae2d.tar.bz2 linux-a2fb49833cad07a53651c23dce508127085fae2d.zip |
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 <alexei.starovoitov@gmail.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/164868907688.21983.1606862921419988152.stgit@devnote2
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/rethook.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/rethook.c b/kernel/trace/rethook.c index ab463a4d2b23..b56833700d23 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); } |