Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-12 22:18:26 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-12 22:21:31 +0100
commitf418b8eac91b66d6c3c3f601fb3077a83a2ce280 (patch)
tree38ce6e9bf0733b373763cb7bbe033f67c6f39aba
parent3eea580e6beb07e5ecdae946f1c682e155d1d5e6 (diff)
perf tests evsel-tp-sched: Fix bitwise operator (bnc#1012628).
-rw-r--r--patches.kernel.org/4.20.8-338-perf-tests-evsel-tp-sched-Fix-bitwise-operator.patch48
-rw-r--r--series.conf1
2 files changed, 49 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.8-338-perf-tests-evsel-tp-sched-Fix-bitwise-operator.patch b/patches.kernel.org/4.20.8-338-perf-tests-evsel-tp-sched-Fix-bitwise-operator.patch
new file mode 100644
index 0000000000..9a7c4c4de9
--- /dev/null
+++ b/patches.kernel.org/4.20.8-338-perf-tests-evsel-tp-sched-Fix-bitwise-operator.patch
@@ -0,0 +1,48 @@
+From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
+Date: Tue, 22 Jan 2019 17:34:39 -0600
+Subject: [PATCH] perf tests evsel-tp-sched: Fix bitwise operator
+References: bnc#1012628
+Patch-mainline: 4.20.8
+Git-commit: 489338a717a0dfbbd5a3fabccf172b78f0ac9015
+
+commit 489338a717a0dfbbd5a3fabccf172b78f0ac9015 upstream.
+
+Notice that the use of the bitwise OR operator '|' always leads to true
+in this particular case, which seems a bit suspicious due to the context
+in which this expression is being used.
+
+Fix this by using bitwise AND operator '&' instead.
+
+This bug was detected with the help of Coccinelle.
+
+Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
+Acked-by: Jiri Olsa <jolsa@kernel.org>
+Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: stable@vger.kernel.org
+Fixes: 6a6cd11d4e57 ("perf test: Add test for the sched tracepoint format fields")
+Link: http://lkml.kernel.org/r/20190122233439.GA5868@embeddedor
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ tools/perf/tests/evsel-tp-sched.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c
+index 5f8501c68da4..5cbba70bcdd0 100644
+--- a/tools/perf/tests/evsel-tp-sched.c
++++ b/tools/perf/tests/evsel-tp-sched.c
+@@ -17,7 +17,7 @@ static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name,
+ return -1;
+ }
+
+- is_signed = !!(field->flags | TEP_FIELD_IS_SIGNED);
++ is_signed = !!(field->flags & TEP_FIELD_IS_SIGNED);
+ if (should_be_signed && !is_signed) {
+ pr_debug("%s: \"%s\" signedness(%d) is wrong, should be %d\n",
+ evsel->name, name, is_signed, should_be_signed);
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index 33cba94c68..3ee7884d91 100644
--- a/series.conf
+++ b/series.conf
@@ -1074,6 +1074,7 @@
patches.kernel.org/4.20.8-335-perf-x86-intel-Delay-memory-deallocation-until.patch
patches.kernel.org/4.20.8-336-x86-MCE-Initialize-mce.bank-in-the-case-of-a-f.patch
patches.kernel.org/4.20.8-337-perf-core-Don-t-WARN-for-impossible-ring-buffe.patch
+ patches.kernel.org/4.20.8-338-perf-tests-evsel-tp-sched-Fix-bitwise-operator.patch
########################################################
# Build fixes that apply to the vanilla kernel too.