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+
这个提交包含在:
Alexander Shishkin
2017-02-24 16:04:15 +02:00
父节点 4495c08e84
当前提交 e609ccef52

查看文件

@@ -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;
}