]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
tracing: probeevent: Fix uninitialized used of offset in parse args
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 12 Oct 2018 16:50:22 +0000 (12:50 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 12 Oct 2018 16:50:22 +0000 (12:50 -0400)
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>
kernel/trace/trace_probe.c

index 5b3d573b3dcfe6caafaa54273c985fb9f0304fee..3ef15a6683c002bc2c5402b5be8ad07c903021bc 100644 (file)
@@ -209,7 +209,7 @@ parse_probe_arg(char *arg, const struct fetch_type *type,
 {
        struct fetch_insn *code = *pcode;
        unsigned long param;
-       long offset;
+       long offset = 0;
        char *tmp;
        int ret = 0;