From: Tianyou Li Date: Mon, 20 Oct 2025 07:30:05 +0000 (+0800) Subject: perf annotate: Check return value of evsel__get_arch() properly X-Git-Tag: v6.19-rc1~61^2~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1204e5846d22fb2fffbd1164eeb19535f306797;p=thirdparty%2Fkernel%2Flinux.git 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: 0669729eb0afb0cf ("perf annotate: Factor out evsel__get_arch()") Suggested-by: James Clark Acked-by: Namhyung Kim Signed-off-by: Tianyou Li Signed-off-by: Namhyung Kim --- diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 39d6594850f13..859e802a1e5ea 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -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)