From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk,
oprofile-list <oprofile-list@lists.sourceforge.net>,
Robert Richter <robert.richter@amd.com>
Subject: [04/16] oprofile: Free potentially owned tasks in case of errors
Date: Fri, 16 Dec 2011 12:49:37 -0800 [thread overview]
Message-ID: <20111216205042.705238600@clark.kroah.org> (raw)
In-Reply-To: <20111216205049.GA28030@kroah.com>
2.6.32-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Robert Richter <robert.richter@amd.com>
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 <robert.richter@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
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
@@ -140,6 +140,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;
@@ -173,6 +180,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;
@@ -191,10 +199,7 @@ void sync_stop(void)
mutex_unlock(&buffer_mutex);
flush_scheduled_work();
- /* make sure we don't leak task structs */
- process_task_mortuary();
- process_task_mortuary();
-
+ free_all_tasks();
free_cpumask_var(marked_cpus);
}
next prev parent reply other threads:[~2011-12-16 20:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-16 20:50 [00/16] 2.6.32.51-longterm review Greg KH
2011-12-16 20:49 ` [01/16] ALSA: sis7019 - give slow codecs more time to reset Greg KH
2011-12-16 20:49 ` [02/16] ALSA: hda/realtek - Fix Oops in alc_mux_select() Greg KH
2011-12-16 20:49 ` [03/16] ARM: davinci: dm646x evm: wrong register used in setup_vpif_input_channel_mode Greg KH
2011-12-16 20:49 ` Greg KH [this message]
2011-12-16 20:49 ` [05/16] oprofile: Fix locking dependency in sync_start() Greg KH
2011-12-16 20:49 ` [06/16] percpu: fix chunk range calculation Greg KH
2011-12-16 20:49 ` [07/16] xfrm: Fix key lengths for rfc3686(ctr(aes)) Greg KH
2011-12-16 20:49 ` [08/16] linux/log2.h: Fix rounddown_pow_of_two(1) Greg KH
2011-12-16 20:49 ` [09/16] jbd/jbd2: validate sb->s_first in journal_get_superblock() Greg KH
2011-12-16 20:49 ` [10/16] Make TASKSTATS require root access Greg KH
2011-12-16 20:49 ` [11/16] hfs: fix hfs_find_init() sb->ext_tree NULL ptr oops Greg KH
2011-12-16 20:49 ` [12/16] export __get_user_pages_fast() function Greg KH
2011-12-16 20:49 ` [13/16] [PATCH 2/3] oprofile, x86: Fix nmi-unsafe callgraph support Greg KH
2011-12-18 16:04 ` Robert Richter
2011-12-22 20:37 ` Greg KH
2011-12-16 20:49 ` [14/16] [PATCH 3/3] oprofile, x86: Fix crash when unloading module (timer mode) Greg KH
2011-12-16 20:49 ` [15/16] ext4: avoid hangs in ext4_da_should_update_i_disksize() Greg KH
2011-12-16 20:49 ` [16/16] USB: cdc-acm: add IDs for Motorola H24 HSPA USB module Greg KH
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=20111216205042.705238600@clark.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=oprofile-list@lists.sourceforge.net \
--cc=robert.richter@amd.com \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®