Commit 72687432 authored by Quentin Monnet's avatar Quentin Monnet Committed by Greg Kroah-Hartman

tools: bpftool: fix arguments for p_err() in do_event_pipe()

[ Upstream commit 9def249d ]

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: f412eed9 ("tools: bpftool: add simple perf event output reader")
Signed-off-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 9695c9b5
...@@ -205,7 +205,7 @@ int do_event_pipe(int argc, char **argv) ...@@ -205,7 +205,7 @@ int do_event_pipe(int argc, char **argv)
NEXT_ARG(); NEXT_ARG();
cpu = strtoul(*argv, &endptr, 0); cpu = strtoul(*argv, &endptr, 0);
if (*endptr) { 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; goto err_close_map;
} }
...@@ -216,7 +216,7 @@ int do_event_pipe(int argc, char **argv) ...@@ -216,7 +216,7 @@ int do_event_pipe(int argc, char **argv)
NEXT_ARG(); NEXT_ARG();
index = strtoul(*argv, &endptr, 0); index = strtoul(*argv, &endptr, 0);
if (*endptr) { if (*endptr) {
p_err("can't parse %s as index", **argv); p_err("can't parse %s as index", *argv);
goto err_close_map; goto err_close_map;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment