File perf-intel-pt-Fix-next-err-value-walking-trace.patch of Package perf
35
1
From: Adrian Hunter <adrian.hunter@intel.com>
2
Date: Fri, 10 Dec 2021 18:23:01 +0200
3
Subject: perf intel-pt: Fix next 'err' value, walking trace
4
Git-commit: a32e6c5da599dbf49e60622a4dfb5b9b40ece029
5
Patch-mainline: v5.16-rc5
6
References: git-fixes
7
8
Code after label 'next:' in intel_pt_walk_trace() assumes 'err' is zero,
9
but it may not be, if arrived at via a 'goto'. Ensure it is zero.
10
11
Fixes: 7c1b16ba0e26e6 ("perf intel-pt: Add support for decoding FUP/TIP only")
12
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
13
Cc: Jiri Olsa <jolsa@redhat.com>
14
Cc: stable@vger.kernel.org # v5.15+
15
Link: https://lore.kernel.org/r/20211210162303.2288710-6-adrian.hunter@intel.com
16
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
17
Signed-off-by: Tony Jones <tonyj@suse.de>
18
---
19
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 1 +
20
1 file changed, 1 insertion(+)
21
22
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
23
index 845b0ca866a4..75b504aed7f4 100644
24
--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
25
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
26
27
if (err)
28
return err;
29
next:
30
+ err = 0;
31
if (decoder->cyc_threshold) {
32
if (decoder->sample_cyc && last_packet_type != INTEL_PT_CYC)
33
decoder->sample_cyc = false;
34
35