Skip to content

Commit a2fb498

Browse files
mhiramatAlexei Starovoitov
authored andcommitted
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
1 parent 2609f63 commit a2fb498

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/trace/rethook.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void rethook_free_rcu(struct rcu_head *head)
6565
*/
6666
void rethook_free(struct rethook *rh)
6767
{
68-
rcu_assign_pointer(rh->handler, NULL);
68+
WRITE_ONCE(rh->handler, NULL);
6969

7070
call_rcu(&rh->rcu, rethook_free_rcu);
7171
}

0 commit comments

Comments
 (0)