intel_th: Don't leak module refcount on failure to activate
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Fri, 24 Feb 2017 14:04:15 +0000 (16:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Mar 2017 07:41:27 +0000 (09:41 +0200)
commit3076066bb5076411627f9dffd9d59ff2497f7eac
tree9cfd8575bea63bf682a64d630a5bfc58ed70ca5c
parentb176a6eed370dce9f96445d75d3f19c5db3f6bbf
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>
drivers/hwtracing/intel_th/core.c