summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2017-02-24 15:04:15 +0100
committerAlexander Shishkin <alexander.shishkin@linux.intel.com>2017-03-15 13:54:57 +0100
commite609ccef5222c73b46b322be7d3796d60bff353d (patch)
tree3f96ebd7672d7571b7b7c014f169ef6124ecfad2
parentLinux 4.11-rc2 (diff)
downloadlinux-e609ccef5222c73b46b322be7d3796d60bff353d.tar.xz
linux-e609ccef5222c73b46b322be7d3796d60bff353d.zip
intel_th: Don't leak module refcount on failure to activate
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> Cc: stable@vger.kernel.org # v4.8+
-rw-r--r--drivers/hwtracing/intel_th/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index cdd9b3b26195..7563eceeaaea 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -221,8 +221,10 @@ static int intel_th_output_activate(struct intel_th_device *thdev)
else
intel_th_trace_enable(thdev);
- if (ret)
+ if (ret) {
pm_runtime_put(&thdev->dev);
+ module_put(thdrv->driver.owner);
+ }
return ret;
}