diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index b795f27f2602..35235147b111 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -838,8 +838,10 @@ static int evsel__get_arch(struct evsel *evsel, struct arch **parch) struct arch *arch; int err; - if (!arch_name) + if (!arch_name) { + *parch = NULL; return errno; + } *parch = arch = arch__find(arch_name); if (arch == NULL) {