From: Masami Hiramatsu <mhiramat@kernel.org>
To: Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
kernel-janitors@vger.kernel.org,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Jiri Olsa <jolsa@kernel.org>,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH bpf-next 1/2] fprobe: Fix smatch type mismatch warning
Date: Wed, 23 Mar 2022 16:35:26 +0900 [thread overview]
Message-ID: <164802092611.1732982.12268174743437084619.stgit@devnote2> (raw)
In-Reply-To: <164802091567.1732982.1242854551611267542.stgit@devnote2>
Fix the type mismatching warning of 'rethook_node vs fprobe_rethook_node'
found by Smatch.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
kernel/trace/fprobe.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
index 8b2dd5b9dcd1..63b2321b22a0 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;
}
next prev parent reply other threads:[~2022-03-23 7:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-23 7:35 [PATCH bpf-next 0/2] fprobe: Fixes for Sparse and Smatch warnings Masami Hiramatsu
2022-03-23 7:35 ` Masami Hiramatsu [this message]
2022-03-23 7:35 ` [PATCH bpf-next 2/2] fprobe: Fix sparse warning for acccessing __rcu ftrace_hash Masami Hiramatsu
2022-03-29 2:20 ` [PATCH bpf-next 0/2] fprobe: Fixes for Sparse and Smatch warnings patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=164802092611.1732982.12268174743437084619.stgit@devnote2 \
--to=mhiramat@kernel.org \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=jolsa@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox