Commit 31537cf8 authored by Steven Rostedt (VMware)'s avatar Steven Rostedt (VMware) Committed by Peter Zijlstra

tracing: Initialize ret in syscall_enter_define_fields()

If syscall_enter_define_fields() is called on a system call with no
arguments, the return code variable "ret" will never get initialized.
Initialize it to zero.

Fixes: 04ae87a5 ("ftrace: Rework event_create_dir()")
Reported-by: default avatarQian Cai <cai@lca.pw>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/0FA8C6E3-D9F5-416D-A1B0-5E4CD583A101@lca.pw
parent e4add247
......@@ -274,7 +274,8 @@ static int __init syscall_enter_define_fields(struct trace_event_call *call)
struct syscall_trace_enter trace;
struct syscall_metadata *meta = call->data;
int offset = offsetof(typeof(trace), args);
int ret, i;
int ret = 0;
int i;
for (i = 0; i < meta->nb_args; i++) {
ret = trace_define_field(call, meta->types[i],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment