aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-02-13 22:29:07 -0500
committerTejun Heo <tj@kernel.org>2013-02-13 22:29:07 -0500
commit1dd638149f1f9d7d7dbb32591d5c7c2a0ea36264 (patch)
tree454399689b5d5016eefbd9f12e39b2674a8ebb33 /kernel/workqueue.c
parent8594fade39d3ad02ef856b8c53b5d7cc538a55f5 (diff)
workqueue: fix is_chained_work() regression
c9e7cf273f ("workqueue: move busy_hash from global_cwq to worker_pool") incorrectly converted is_chained_work() to use get_gcwq() inside for_each_gcwq_cpu() while removing get_gcwq(). As cwq might not exist for all possible workqueue CPUs, @cwq can be NULL and the following cwq deferences can lead to oops. Fix it by using for_each_cwq_cpu() instead, which is the better one to use anyway as we only need to check pools that the wq is associated with. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index d6fdce12ca7e..0d26ab3aee59 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1167,7 +1167,7 @@ static bool is_chained_work(struct workqueue_struct *wq)
1167 unsigned long flags; 1167 unsigned long flags;
1168 unsigned int cpu; 1168 unsigned int cpu;
1169 1169
1170 for_each_wq_cpu(cpu) { 1170 for_each_cwq_cpu(cpu, wq) {
1171 struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq); 1171 struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq);
1172 struct worker_pool *pool = cwq->pool; 1172 struct worker_pool *pool = cwq->pool;
1173 struct worker *worker; 1173 struct worker *worker;