diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2014-06-03 07:33:08 (GMT) |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-06-19 16:32:27 (GMT) |
commit | 92b69f509196fc5afc6a357511b864d372f42419 (patch) | |
tree | 8b1a01763814cc6dee4f97f278e4c84656bcf18f /kernel | |
parent | b62c075194f409ed887670af897ad22d44ed8ac8 (diff) | |
download | linux-92b69f509196fc5afc6a357511b864d372f42419.tar.xz |
workqueue: sanity check pool->cpu in wq_worker_sleeping()
In theory, pool->cpu is equals to @cpu in wq_worker_sleeping() after
worker->flags is checked.
And "pool->cpu != cpu" sanity check will help us if something wrong.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/workqueue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 4f8d72d..8474e57 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -843,7 +843,7 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task, int cpu) pool = worker->pool; /* this can only happen on the local cpu */ - if (WARN_ON_ONCE(cpu != raw_smp_processor_id())) + if (WARN_ON_ONCE(cpu != raw_smp_processor_id() || pool->cpu != cpu)) return NULL; /* |