Message ID | 20230728001212.457900-2-irogers@google.com (mailing list archive) |
---|---|
State | Handled Elsewhere |
Delegated to: | BPF |
Headers | show |
Series | Remove BPF arrays from perf event parsing | expand |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 926d3ac97324..02647313c918 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -758,7 +758,7 @@ int parse_events_load_bpf_obj(struct parse_events_state *parse_state, return 0; errout: - parse_events_error__handle(parse_state->error, param.loc->first_column, + parse_events_error__handle(parse_state->error, param.loc ? param.loc->first_column : 0, strdup(errbuf), strdup("(add -v to see detail)")); return err; }
loc is passed as NULL in tools/perf/tests/bpf.c do_test, meaning errors trigger a segv when trying to access. Add the missing NULL check. Signed-off-by: Ian Rogers <irogers@google.com> --- tools/perf/util/parse-events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)