Skip to content

Commit

Permalink
fprobe: Fix sparse warning for acccessing __rcu ftrace_hash
Browse files Browse the repository at this point in the history
Since ftrace_ops::local_hash::filter_hash field is an __rcu pointer,
we have to use rcu_access_pointer() to access it.

Reported-by: kernel test robot <[email protected]>
Signed-off-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/164802093635.1732982.4938094876018890866.stgit@devnote2
  • Loading branch information
mhiramat authored and Alexei Starovoitov committed Mar 29, 2022
1 parent 9052e4e commit 261608f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/fprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ int register_fprobe(struct fprobe *fp, const char *filter, const char *notfilter
* correctly calculate the total number of filtered symbols
* from both filter and notfilter.
*/
hash = fp->ops.local_hash.filter_hash;
hash = rcu_access_pointer(fp->ops.local_hash.filter_hash);
if (WARN_ON_ONCE(!hash))
goto out;

Expand Down

0 comments on commit 261608f

Please sign in to comment.