Browse Source

tracing: probeevent: Fix uninitialized used of offset in parse args

Dan's smatch utility found an uninitialized use of offset in a path in
parse_probe_args(). Unless an offset is specifically specified for commands
that allow them, it should default to zero.

Link: http://lkml.kernel.org/r/20181012134246.5doqaobxunlqqs53@mwanda
Fixes: 533059281ee5 ("tracing: probeevent: Introduce new argument fetching code")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> (smatch)
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Steven Rostedt (VMware) 6 years ago
parent
commit
bf173ca92d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      kernel/trace/trace_probe.c

+ 1 - 1
kernel/trace/trace_probe.c

@@ -209,7 +209,7 @@ parse_probe_arg(char *arg, const struct fetch_type *type,
 {
 {
 	struct fetch_insn *code = *pcode;
 	struct fetch_insn *code = *pcode;
 	unsigned long param;
 	unsigned long param;
-	long offset;
+	long offset = 0;
 	char *tmp;
 	char *tmp;
 	int ret = 0;
 	int ret = 0;