author | xindong.xu <xindong.xu@amlogic.com> | 2018-03-09 10:57:18 (GMT) |
---|---|---|
committer | Gerrit Code Review <gituser@li1005-239.members.linode.com> | 2018-03-09 10:57:18 (GMT) |
commit | b994b89e914d5fbab84387217f604115a1faf74a (patch) | |
tree | 13170541b1176b48ea87f117a4ff518780ed1553 | |
parent | 82fe04c4a4fb6753e42f2cadf9484a04fb58bb01 (diff) | |
parent | 2629f21228bc780c9488123a42387ecad3d09d56 (diff) | |
download | common-b994b89e914d5fbab84387217f604115a1faf74a.zip common-b994b89e914d5fbab84387217f604115a1faf74a.tar.gz common-b994b89e914d5fbab84387217f604115a1faf74a.tar.bz2 |
Merge "kernel: workqueue: avoid process_one_work NULL reference [1/1]" into amlogic-4.9-dev
-rw-r--r-- | kernel/workqueue.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 181c2ad..c272428 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -2013,11 +2013,20 @@ static void process_one_work(struct worker *worker, struct work_struct *work) __releases(&pool->lock) __acquires(&pool->lock) { +#ifdef CONFIG_AMLOGIC_MODIFY + int work_color; + struct worker *collision; + bool cpu_intensive; + struct pool_workqueue *pwq = get_work_pwq(work); + struct worker_pool *pool = worker->pool; +#else struct pool_workqueue *pwq = get_work_pwq(work); struct worker_pool *pool = worker->pool; bool cpu_intensive = pwq->wq->flags & WQ_CPU_INTENSIVE; int work_color; struct worker *collision; +#endif + #ifdef CONFIG_LOCKDEP /* * It is permissible to free the struct work_struct from @@ -2030,6 +2039,14 @@ __acquires(&pool->lock) lockdep_copy_map(&lockdep_map, &work->lockdep_map); #endif +#ifdef CONFIG_AMLOGIC_MODIFY + if (!pwq) { + WARN_ONCE(1, "Warning: pool_workqueue is NULL!!!!!!!!!!!!.\n"); + return; + } + + cpu_intensive = pwq->wq->flags & WQ_CPU_INTENSIVE; +#endif /* ensure we're on the correct CPU */ WARN_ON_ONCE(!(pool->flags & POOL_DISASSOCIATED) && raw_smp_processor_id() != pool->cpu); |