diff options
| author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2014-06-03 15:33:08 +0800 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-12-05 18:08:28 +0100 |
| commit | 7578eb53f7b6a461791fdd18ef70eef1da4da47d (patch) | |
| tree | bddc3528a3bcf0458b0c67836117d23bb08212e7 /kernel/workqueue.c | |
| parent | c22e60b161d210ba397a16ddd690f9c562102f6a (diff) | |
| download | android_kernel_m2note-7578eb53f7b6a461791fdd18ef70eef1da4da47d.tar.gz | |
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/workqueue.c')
| -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 2f1ec52c8..118431095 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -895,7 +895,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; /* |
