From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Greg KH <greg@kroah.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>,
Chunyan Zhang <zhang.chunyan@linaro.org>,
laurent.fert@intel.com, linux-kernel@vger.kernel.org,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
stable@vger.kernel.org#v4.8+
Subject: [QUEUED v20170314 1/3] intel_th: msu: Don't leak module refcount on failure to activate
Date: Tue, 14 Mar 2017 13:32:40 +0200 [thread overview]
Message-ID: <20170314113242.2249-2-alexander.shishkin@linux.intel.com> (raw)
In-Reply-To: <20170314113242.2249-1-alexander.shishkin@linux.intel.com>
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+
---
drivers/hwtracing/intel_th/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index cdd9b3b261..7563eceeaa 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;
}
--
2.11.0
next prev parent reply other threads:[~2017-03-14 11:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-14 11:32 [QUEUED v20170314 0/3] intel_th: Fixes for 4.11 Alexander Shishkin
2017-03-14 11:32 ` Alexander Shishkin [this message]
2017-03-14 11:32 ` [QUEUED v20170314 2/3] intel_th: pci: Add Denverton SOC support Alexander Shishkin
2017-03-14 11:32 ` [QUEUED v20170314 3/3] intel_th: pci: Add Gemini Lake support Alexander Shishkin
2017-03-14 11:39 ` [QUEUED v20170314 0/3] intel_th: Fixes for 4.11 Alexander Shishkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170314113242.2249-2-alexander.shishkin@linux.intel.com \
--to=alexander.shishkin@linux.intel.com \
--cc=greg@kroah.com \
--cc=laurent.fert@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=stable@vger.kernel.org#v4.8+ \
--cc=zhang.chunyan@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.