tools: bpftool: fix arguments for p_err() in do_event_pipe()
[ Upstream commit 9def249dc8409ffc1f5a1d7195f1c462f2b49c07 ]
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: f412eed9df
("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
9695c9b53f
commit
7268743209
@ -205,7 +205,7 @@ int do_event_pipe(int argc, char **argv)
|
||||
NEXT_ARG();
|
||||
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;
|
||||
}
|
||||
|
||||
@ -216,7 +216,7 @@ int do_event_pipe(int argc, char **argv)
|
||||
NEXT_ARG();
|
||||
index = 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user