stm class: Fix unbalanced module/device refcounting
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Mon, 15 Feb 2016 17:12:07 +0000 (19:12 +0200)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Wed, 1 Jun 2016 21:28:47 +0000 (15:28 -0600)
commit984a45ed12b5c04728f85e9c258ba1ae9ebac2d3
treee3a576d252e36613b6c8430433845348540b9289
parentdd5219ad9e3d488a42c341c10a5ee060d0a322dd
stm class: Fix unbalanced module/device refcounting

STM code takes references to the stm device and its module for the
duration of the character device's existence or the stm_source link.
Dropping these references is not well balanced everywhere, which may
lead to leaks.

This patch balances the acquisition and releasing of these two
references and annotates each site so that it's easier to verify
correctness by reading the code.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f7c81c7176c72c7899390754b4b038a64b296e4d)
drivers/hwtracing/stm/core.c