diff options
author | Alexei Starovoitov <ast@kernel.org> | 2022-03-29 05:05:41 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2022-03-29 05:05:41 +0300 |
commit | 76db1784c1982b3374cf25876691d20707f82dda (patch) | |
tree | 3a4e4e6165115f3f3cc8923b07a697fe5b81b728 | |
parent | 8c1b21198551d795a44f08ad185f716732b47bbe (diff) | |
parent | 261608f3105ce65e9fd01919f72ead74dcb9f14d (diff) | |
download | linux-76db1784c1982b3374cf25876691d20707f82dda.tar.xz |
Merge branch 'fprobe: Fixes for Sparse and Smatch warnings'
Masami Hiramatsu says:
====================
Hi,
These fprobe patches are for fixing the warnings by Smatch and sparse.
This is arch independent part of the fixes.
Thank you,
---
====================
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r-- | kernel/trace/fprobe.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c index 8b2dd5b9dcd1..89d9f994ebb0 100644 --- a/kernel/trace/fprobe.c +++ b/kernel/trace/fprobe.c @@ -150,15 +150,15 @@ static int fprobe_init_rethook(struct fprobe *fp, int num) fp->rethook = rethook_alloc((void *)fp, fprobe_exit_handler); for (i = 0; i < size; i++) { - struct rethook_node *node; + struct fprobe_rethook_node *node; - node = kzalloc(sizeof(struct fprobe_rethook_node), GFP_KERNEL); + node = kzalloc(sizeof(*node), GFP_KERNEL); if (!node) { rethook_free(fp->rethook); fp->rethook = NULL; return -ENOMEM; } - rethook_add_node(fp->rethook, node); + rethook_add_node(fp->rethook, &node->node); } return 0; } @@ -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; |