perf annotate: Check return value of evsel__get_arch() properly

Check the error code of evsel__get_arch() in the symbol__annotate().
Previously it checked non-zero value but after the refactoring it does
only for negative values.

Fixes: 0669729eb0 ("perf annotate: Factor out evsel__get_arch()")
Suggested-by: James Clark <james.clark@linaro.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Tianyou Li <tianyou.li@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
Tianyou Li 2025-10-20 15:30:05 +08:00 committed by Namhyung Kim
parent 262c61435c
commit f1204e5846

View File

@ -1021,7 +1021,7 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel,
int err, nr;
err = evsel__get_arch(evsel, &arch);
if (err < 0)
if (err)
return err;
if (parch)