* [PATCH] tracing: Initialize ret in syscall_enter_define_fields()
@ 2020-01-08 13:57 Steven Rostedt
2020-01-08 15:03 ` Peter Zijlstra
0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2020-01-08 13:57 UTC (permalink / raw)
To: LKML; +Cc: Peter Zijlstra, Ingo Molnar, Qian Cai
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
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.
Link: https://lore.kernel.org/r/0FA8C6E3-D9F5-416D-A1B0-5E4CD583A101@lca.pw
Fixes: 04ae87a52074e ("ftrace: Rework event_create_dir()")
Reported-by: Qian Cai <cai@lca.pw>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
kernel/trace/trace_syscalls.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 73140d80dd46..2978c29d87d4 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -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],
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tracing: Initialize ret in syscall_enter_define_fields()
2020-01-08 13:57 [PATCH] tracing: Initialize ret in syscall_enter_define_fields() Steven Rostedt
@ 2020-01-08 15:03 ` Peter Zijlstra
0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2020-01-08 15:03 UTC (permalink / raw)
To: Steven Rostedt; +Cc: LKML, Ingo Molnar, Qian Cai
On Wed, Jan 08, 2020 at 08:57:55AM -0500, Steven Rostedt wrote:
>
> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
>
> 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.
>
> Link: https://lore.kernel.org/r/0FA8C6E3-D9F5-416D-A1B0-5E4CD583A101@lca.pw
> Fixes: 04ae87a52074e ("ftrace: Rework event_create_dir()")
> Reported-by: Qian Cai <cai@lca.pw>
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Thanks Steve!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-08 15:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 13:57 [PATCH] tracing: Initialize ret in syscall_enter_define_fields() Steven Rostedt
2020-01-08 15:03 ` Peter Zijlstra
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.