]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.0.19/stm-class-fix-channel-free-in-stm-output-free-path.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.0.19 / stm-class-fix-channel-free-in-stm-output-free-path.patch
CommitLineData
427cc94b
GKH
1From ee496da4c3915de3232b5f5cd20e21ae3e46fe8d Mon Sep 17 00:00:00 2001
2From: Tingwei Zhang <tingwei@codeaurora.org>
3Date: Wed, 17 Apr 2019 10:35:34 +0300
4Subject: stm class: Fix channel free in stm output free path
5
6From: Tingwei Zhang <tingwei@codeaurora.org>
7
8commit ee496da4c3915de3232b5f5cd20e21ae3e46fe8d upstream.
9
10Number of free masters is not set correctly in stm
11free path. Fix this by properly adding the number
12of output channels before setting them to 0 in
13stm_output_disclaim().
14
15Currently it is equivalent to doing nothing since
16master->nr_free is incremented by 0.
17
18Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices")
19Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org>
20Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
21Cc: stable@vger.kernel.org # v4.4
22Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25---
26 drivers/hwtracing/stm/core.c | 2 +-
27 1 file changed, 1 insertion(+), 1 deletion(-)
28
29--- a/drivers/hwtracing/stm/core.c
30+++ b/drivers/hwtracing/stm/core.c
31@@ -218,8 +218,8 @@ stm_output_disclaim(struct stm_device *s
32 bitmap_release_region(&master->chan_map[0], output->channel,
33 ilog2(output->nr_chans));
34
35- output->nr_chans = 0;
36 master->nr_free += output->nr_chans;
37+ output->nr_chans = 0;
38 }
39
40 /*