This is a note to let you know that I've just added the patch titled
oprofile: Free potentially owned tasks in case of errors
to the 2.6.39-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:
oprofile-free-potentially-owned-tasks-in-case-of-errors.patch
and it can be found in the queue-2.6.39 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 6ac6519b93065625119a347be1cbcc1b89edb773 Mon Sep 17 00:00:00 2001
From: Robert Richter <[email protected]>
Date: Thu, 26 May 2011 18:22:54 +0200
Subject: oprofile: Free potentially owned tasks in case of errors
From: Robert Richter <[email protected]>
commit 6ac6519b93065625119a347be1cbcc1b89edb773 upstream.
After registering the task free notifier we possibly have tasks in our
dying_tasks list. Free them after unregistering the notifier in case
of an error.
Signed-off-by: Robert Richter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/oprofile/buffer_sync.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -141,6 +141,13 @@ static struct notifier_block module_load
.notifier_call = module_load_notify,
};
+static void free_all_tasks(void)
+{
+ /* make sure we don't leak task structs */
+ process_task_mortuary();
+ process_task_mortuary();
+}
+
int sync_start(void)
{
int err;
@@ -174,6 +181,7 @@ out3:
profile_event_unregister(PROFILE_TASK_EXIT, &task_exit_nb);
out2:
task_handoff_unregister(&task_free_nb);
+ free_all_tasks();
out1:
free_cpumask_var(marked_cpus);
goto out;
@@ -192,10 +200,7 @@ void sync_stop(void)
mutex_unlock(&buffer_mutex);
flush_cpu_work();
- /* make sure we don't leak task structs */
- process_task_mortuary();
- process_task_mortuary();
-
+ free_all_tasks();
free_cpumask_var(marked_cpus);
}
Patches currently in stable-queue which might be from [email protected] are
queue-2.6.39/oprofile-dcookies-fix-possible-circular-locking-dependency.patch
queue-2.6.39/oprofile-free-potentially-owned-tasks-in-case-of-errors.patch
queue-2.6.39/oprofile-fix-locking-dependency-in-sync_start.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable