diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2006-06-25 08:49:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:01:22 -0400 |
commit | fc75cdfa5b43ac4d3232b490800cd35063adafd3 (patch) | |
tree | 0529ffd9633667457d5340a09b3cb352d09436d2 /kernel/workqueue.c | |
parent | 04a3446c90137a473837288b04b517b19dc67a0d (diff) |
[PATCH] cpu hotplug: fix CPU_UP_CANCEL handling
If a cpu hotplug callback fails on CPU_UP_PREPARE, all callbacks will be
called with CPU_UP_CANCELED. A few of these callbacks assume that on
CPU_UP_PREPARE a pointer to task has been stored in a percpu array. This
assumption is not true if CPU_UP_PREPARE fails and the following calls to
kthread_bind() in CPU_UP_CANCELED will cause an addressing exception
because of passing a NULL pointer.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index f869aff6bc0c..565cf7a1febd 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -590,6 +590,8 @@ static int workqueue_cpu_callback(struct notifier_block *nfb, | |||
590 | 590 | ||
591 | case CPU_UP_CANCELED: | 591 | case CPU_UP_CANCELED: |
592 | list_for_each_entry(wq, &workqueues, list) { | 592 | list_for_each_entry(wq, &workqueues, list) { |
593 | if (!per_cpu_ptr(wq->cpu_wq, hotcpu)->thread) | ||
594 | continue; | ||
593 | /* Unbind so it can run. */ | 595 | /* Unbind so it can run. */ |
594 | kthread_bind(per_cpu_ptr(wq->cpu_wq, hotcpu)->thread, | 596 | kthread_bind(per_cpu_ptr(wq->cpu_wq, hotcpu)->thread, |
595 | any_online_cpu(cpu_online_map)); | 597 | any_online_cpu(cpu_online_map)); |