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.12.63~300 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8c93fe1c444a8bf0272555731aba775adf2046c;p=thirdparty%2Fkernel%2Fstable.git perf annotate: Check return value of evsel__get_arch() properly [ Upstream commit f1204e5846d22fb2fffbd1164eeb19535f306797 ] 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 Signed-off-by: Sasha Levin --- diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 37ce43c4eb8f6..cb8f191e19fd9 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -974,7 +974,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)