Skip to content

Commit 10f129c

Browse files
GustavoARSilvarostedt
authored andcommitted
tracing/kprobe: Fix uninitialized variable bug
There is a potential execution path in which variable *ret* is returned without being properly initialized, previously. Fix this by initializing variable *ret* to 0. Link: http://lkml.kernel.org/r/20200205223404.GA3379@embeddedor Addresses-Coverity-ID: 1491142 ("Uninitialized scalar variable") Fixes: 2a588dd ("tracing: Add kprobe event command generation functions") Reviewed-by: Tom Zanussi <zanussi@kernel.org> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 26445f9 commit 10f129c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/trace/trace_kprobe.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ int __kprobe_event_add_fields(struct dynevent_cmd *cmd, ...)
10121012
{
10131013
struct dynevent_arg arg;
10141014
va_list args;
1015-
int ret;
1015+
int ret = 0;
10161016

10171017
if (cmd->type != DYNEVENT_TYPE_KPROBE)
10181018
return -EINVAL;

0 commit comments

Comments
 (0)