aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2017-02-24 16:04:15 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-30 09:44:09 +0200
commitf8dd767b84e2e6d477a760d87999d74c2580ea9a (patch)
tree1354500077f92b7ccadbf7977b0102ae0b169390
parent7bf105ac9277edc445b5158d1aa92e766206d23a (diff)
downloadlinux-yocto-f8dd767b84e2e6d477a760d87999d74c2580ea9a.tar.gz
linux-yocto-f8dd767b84e2e6d477a760d87999d74c2580ea9a.tar.bz2
linux-yocto-f8dd767b84e2e6d477a760d87999d74c2580ea9a.zip
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.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;
}