aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@netronome.com>2019-08-15 10:32:15 -0400
committerAlexei Starovoitov <ast@kernel.org>2019-08-16 01:06:46 -0400
commit9def249dc8409ffc1f5a1d7195f1c462f2b49c07 (patch)
tree1f1e366fef86dfe9cd1619cd547ca5aa0e99157e /tools
parentdadb81d0afe732a7670f7c1bd287dada163a9f2f (diff)
tools: bpftool: fix arguments for p_err() in do_event_pipe()
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/bpf/bpftool/map_perf_ring.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/map_perf_ring.c b/tools/bpf/bpftool/map_perf_ring.c
index 3f108ab17797..4c5531d1a450 100644
--- a/tools/bpf/bpftool/map_perf_ring.c
+++ b/tools/bpf/bpftool/map_perf_ring.c
@@ -157,7 +157,7 @@ int do_event_pipe(int argc, char **argv)
157 NEXT_ARG(); 157 NEXT_ARG();
158 ctx.cpu = strtoul(*argv, &endptr, 0); 158 ctx.cpu = strtoul(*argv, &endptr, 0);
159 if (*endptr) { 159 if (*endptr) {
160 p_err("can't parse %s as CPU ID", **argv); 160 p_err("can't parse %s as CPU ID", *argv);
161 goto err_close_map; 161 goto err_close_map;
162 } 162 }
163 163
@@ -168,7 +168,7 @@ int do_event_pipe(int argc, char **argv)
168 NEXT_ARG(); 168 NEXT_ARG();
169 ctx.idx = strtoul(*argv, &endptr, 0); 169 ctx.idx = strtoul(*argv, &endptr, 0);
170 if (*endptr) { 170 if (*endptr) {
171 p_err("can't parse %s as index", **argv); 171 p_err("can't parse %s as index", *argv);
172 goto err_close_map; 172 goto err_close_map;
173 } 173 }
174 174