Skip to content

Commit

Permalink
tracing/kprobe: Fix uninitialized variable bug
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Masami Hiramatsu <[email protected]>
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
GustavoARSilva authored and rostedt committed Feb 10, 2020
1 parent 26445f9 commit 10f129c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_kprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ int __kprobe_event_add_fields(struct dynevent_cmd *cmd, ...)
{
struct dynevent_arg arg;
va_list args;
int ret;
int ret = 0;

if (cmd->type != DYNEVENT_TYPE_KPROBE)
return -EINVAL;
Expand Down

0 comments on commit 10f129c

Please sign in to comment.