提交 76db1784 编写于 作者: A Alexei Starovoitov

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: NAlexei Starovoitov <ast@kernel.org>
...@@ -150,15 +150,15 @@ static int fprobe_init_rethook(struct fprobe *fp, int num) ...@@ -150,15 +150,15 @@ static int fprobe_init_rethook(struct fprobe *fp, int num)
fp->rethook = rethook_alloc((void *)fp, fprobe_exit_handler); fp->rethook = rethook_alloc((void *)fp, fprobe_exit_handler);
for (i = 0; i < size; i++) { 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) { if (!node) {
rethook_free(fp->rethook); rethook_free(fp->rethook);
fp->rethook = NULL; fp->rethook = NULL;
return -ENOMEM; return -ENOMEM;
} }
rethook_add_node(fp->rethook, node); rethook_add_node(fp->rethook, &node->node);
} }
return 0; return 0;
} }
...@@ -215,7 +215,7 @@ int register_fprobe(struct fprobe *fp, const char *filter, const char *notfilter ...@@ -215,7 +215,7 @@ int register_fprobe(struct fprobe *fp, const char *filter, const char *notfilter
* correctly calculate the total number of filtered symbols * correctly calculate the total number of filtered symbols
* from both filter and notfilter. * 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)) if (WARN_ON_ONCE(!hash))
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册