aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/workqueue.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 1ad0ee489cd1..7db251a959c5 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -772,7 +772,7 @@ struct workqueue_struct *__create_workqueue_key(const char *name,
772} 772}
773EXPORT_SYMBOL_GPL(__create_workqueue_key); 773EXPORT_SYMBOL_GPL(__create_workqueue_key);
774 774
775static void cleanup_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu) 775static void cleanup_workqueue_thread(struct cpu_workqueue_struct *cwq)
776{ 776{
777 /* 777 /*
778 * Our caller is either destroy_workqueue() or CPU_DEAD, 778 * Our caller is either destroy_workqueue() or CPU_DEAD,
@@ -808,7 +808,6 @@ static void cleanup_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu)
808void destroy_workqueue(struct workqueue_struct *wq) 808void destroy_workqueue(struct workqueue_struct *wq)
809{ 809{
810 const cpumask_t *cpu_map = wq_cpu_map(wq); 810 const cpumask_t *cpu_map = wq_cpu_map(wq);
811 struct cpu_workqueue_struct *cwq;
812 int cpu; 811 int cpu;
813 812
814 get_online_cpus(); 813 get_online_cpus();
@@ -816,10 +815,8 @@ void destroy_workqueue(struct workqueue_struct *wq)
816 list_del(&wq->list); 815 list_del(&wq->list);
817 spin_unlock(&workqueue_lock); 816 spin_unlock(&workqueue_lock);
818 817
819 for_each_cpu_mask(cpu, *cpu_map) { 818 for_each_cpu_mask(cpu, *cpu_map)
820 cwq = per_cpu_ptr(wq->cpu_wq, cpu); 819 cleanup_workqueue_thread(per_cpu_ptr(wq->cpu_wq, cpu));
821 cleanup_workqueue_thread(cwq, cpu);
822 }
823 put_online_cpus(); 820 put_online_cpus();
824 821
825 free_percpu(wq->cpu_wq); 822 free_percpu(wq->cpu_wq);
@@ -860,7 +857,7 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb,
860 case CPU_UP_CANCELED: 857 case CPU_UP_CANCELED:
861 start_workqueue_thread(cwq, -1); 858 start_workqueue_thread(cwq, -1);
862 case CPU_DEAD: 859 case CPU_DEAD:
863 cleanup_workqueue_thread(cwq, cpu); 860 cleanup_workqueue_thread(cwq);
864 break; 861 break;
865 } 862 }
866 } 863 }