]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tools: bpftool: fix arguments for p_err() in do_event_pipe()
authorQuentin Monnet <quentin.monnet@netronome.com>
Thu, 15 Aug 2019 14:32:15 +0000 (15:32 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 16 Aug 2019 05:06:46 +0000 (22:06 -0700)
The last argument passed to some calls to the p_err() functions is not
correct, it should be "*argv" instead of "**argv". This may lead to a
segmentation fault error if CPU IDs or indices from the command line
cannot be parsed correctly. Let's fix this.

Fixes: f412eed9dfde ("tools: bpftool: add simple perf event output reader")
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/map_perf_ring.c

index 3f108ab177973761a03601e8d69da0719e3bd052..4c5531d1a45002e79f2e0b2de48317bb408d9988 100644 (file)
@@ -157,7 +157,7 @@ int do_event_pipe(int argc, char **argv)
                        NEXT_ARG();
                        ctx.cpu = strtoul(*argv, &endptr, 0);
                        if (*endptr) {
-                               p_err("can't parse %s as CPU ID", **argv);
+                               p_err("can't parse %s as CPU ID", *argv);
                                goto err_close_map;
                        }
 
@@ -168,7 +168,7 @@ int do_event_pipe(int argc, char **argv)
                        NEXT_ARG();
                        ctx.idx = strtoul(*argv, &endptr, 0);
                        if (*endptr) {
-                               p_err("can't parse %s as index", **argv);
+                               p_err("can't parse %s as index", *argv);
                                goto err_close_map;
                        }