]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf annotate: Check return value of evsel__get_arch() properly
authorTianyou Li <tianyou.li@intel.com>
Mon, 20 Oct 2025 07:30:05 +0000 (15:30 +0800)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 21 Oct 2025 12:42:34 +0000 (05:42 -0700)
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 <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>
tools/perf/util/annotate.c

index 39d6594850f136e5bedee51431441c4d0804de68..859e802a1e5ea05066b9364bd17df044c8fdb346 100644 (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)