Skip to content

Commit 31537cf

Browse files
rostedtPeter Zijlstra
authored andcommitted
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: 04ae87a ("ftrace: Rework event_create_dir()") Reported-by: Qian Cai <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e4add24 commit 31537cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/trace/trace_syscalls.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ static int __init syscall_enter_define_fields(struct trace_event_call *call)
274274
struct syscall_trace_enter trace;
275275
struct syscall_metadata *meta = call->data;
276276
int offset = offsetof(typeof(trace), args);
277-
int ret, i;
277+
int ret = 0;
278+
int i;
278279

279280
for (i = 0; i < meta->nb_args; i++) {
280281
ret = trace_define_field(call, meta->types[i],

0 commit comments

Comments
 (0)