diff options
author | Alexander Shishkin <alexander.shishkin@linux.intel.com> | 2017-02-24 09:04:15 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-30 03:41:27 -0400 |
commit | 3076066bb5076411627f9dffd9d59ff2497f7eac (patch) | |
tree | 9cfd8575bea63bf682a64d630a5bfc58ed70ca5c | |
parent | b176a6eed370dce9f96445d75d3f19c5db3f6bbf (diff) |
intel_th: Don't leak module refcount on failure to activate
commit e609ccef5222c73b46b322be7d3796d60bff353d upstream.
Output 'activation' may fail for the reasons of the output driver,
for example, if msc's buffer is not allocated. We forget, however,
to drop the module reference in this case. So each attempt at
activation in this case leaks a reference, preventing the module
from ever unloading.
This patch adds the missing module_put() in the activation error
path.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/hwtracing/intel_th/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c index 6f0a51a2c6ec..d439736c789b 100644 --- a/drivers/hwtracing/intel_th/core.c +++ b/drivers/hwtracing/intel_th/core.c | |||
@@ -218,8 +218,10 @@ static int intel_th_output_activate(struct intel_th_device *thdev) | |||
218 | else | 218 | else |
219 | intel_th_trace_enable(thdev); | 219 | intel_th_trace_enable(thdev); |
220 | 220 | ||
221 | if (ret) | 221 | if (ret) { |
222 | pm_runtime_put(&thdev->dev); | 222 | pm_runtime_put(&thdev->dev); |
223 | module_put(thdrv->driver.owner); | ||
224 | } | ||
223 | 225 | ||
224 | return ret; | 226 | return ret; |
225 | } | 227 | } |