Skip to content

Commit 76db178

Browse files
author
Alexei Starovoitov
committed
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 <[email protected]>
2 parents 8c1b211 + 261608f commit 76db178

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernel/trace/fprobe.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ static int fprobe_init_rethook(struct fprobe *fp, int num)
150150

151151
fp->rethook = rethook_alloc((void *)fp, fprobe_exit_handler);
152152
for (i = 0; i < size; i++) {
153-
struct rethook_node *node;
153+
struct fprobe_rethook_node *node;
154154

155-
node = kzalloc(sizeof(struct fprobe_rethook_node), GFP_KERNEL);
155+
node = kzalloc(sizeof(*node), GFP_KERNEL);
156156
if (!node) {
157157
rethook_free(fp->rethook);
158158
fp->rethook = NULL;
159159
return -ENOMEM;
160160
}
161-
rethook_add_node(fp->rethook, node);
161+
rethook_add_node(fp->rethook, &node->node);
162162
}
163163
return 0;
164164
}
@@ -215,7 +215,7 @@ int register_fprobe(struct fprobe *fp, const char *filter, const char *notfilter
215215
* correctly calculate the total number of filtered symbols
216216
* from both filter and notfilter.
217217
*/
218-
hash = fp->ops.local_hash.filter_hash;
218+
hash = rcu_access_pointer(fp->ops.local_hash.filter_hash);
219219
if (WARN_ON_ONCE(!hash))
220220
goto out;
221221

0 commit comments

Comments
 (0)