From: Tingwei Zhang Date: Wed, 17 Apr 2019 07:35:34 +0000 (+0300) Subject: stm class: Fix channel free in stm output free path X-Git-Tag: v4.19.46~95 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44bc4e8815a4037ef01b4a860ae5743a58dc3736;p=platform%2Fkernel%2Flinux-rpi.git stm class: Fix channel free in stm output free path commit ee496da4c3915de3232b5f5cd20e21ae3e46fe8d upstream. Number of free masters is not set correctly in stm free path. Fix this by properly adding the number of output channels before setting them to 0 in stm_output_disclaim(). Currently it is equivalent to doing nothing since master->nr_free is incremented by 0. Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices") Signed-off-by: Tingwei Zhang Signed-off-by: Sai Prakash Ranjan Cc: stable@vger.kernel.org # v4.4 Signed-off-by: Alexander Shishkin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index 9d55e104400c..1caca7376e74 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -218,8 +218,8 @@ stm_output_disclaim(struct stm_device *stm, struct stm_output *output) bitmap_release_region(&master->chan_map[0], output->channel, ilog2(output->nr_chans)); - output->nr_chans = 0; master->nr_free += output->nr_chans; + output->nr_chans = 0; } /*