Skip to contentSkip to conversation

Patch "intel_th: Don't leak module refcount on failure to activate" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Mar 28, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

intel_th: Don't leak module refcount on failure to activate

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
intel_th-don-t-leak-module-refcount-on-failure-to-activate.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From e609ccef5222c73b46b322be7d3796d60bff353d Mon Sep 17 00:00:00 2001

From: Alexander Shishkin <[email protected]>
Date: Fri, 24 Feb 2017 16:04:15 +0200
Subject: intel_th: Don't leak module refcount on failure to activate

From: Alexander Shishkin <[email protected]>

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.

---
 drivers/hwtracing/intel_th/core.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hwtracing/intel_th/core.c +3 -1
@@ -218,8 +218,10 @@ static int intel_th_output_activate(stru
 	else
 		intel_th_trace_enable(thdev);
 
-	if (ret)
+	if (ret) {
 		pm_runtime_put(&thdev->dev);
+		module_put(thdrv->driver.owner);
+	}
 
 	return ret;
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/intel_th-don-t-leak-module-refcount-on-failure-to-activate.patch