]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:02:33 +0000 (14:02 +0100)
[ 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 <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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/util/annotate.c

index a2e34f149a074af93703eae03305d6d47c223151..1d6900033b3a0cc647796b97011f6dfe64a05067 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)