summaryrefslogtreecommitdiff
authorxindong.xu <xindong.xu@amlogic.com>2018-03-09 10:57:29 (GMT)
committer Gerrit Code Review <gituser@li1005-239.members.linode.com>2018-03-09 10:57:29 (GMT)
commitb9295261c1ffefafbbd27fe944af3f8ea13d09c6 (patch)
treea864d0214bf6d8cbfd0a0e6ba7aaa88346c5d0a5
parent17a8d5fa7fb7fda145b6814867b90f65ffe2bdd6 (diff)
parent67e65a5da38ce6fca0006755117386c5aa6db217 (diff)
downloadcommon-b9295261c1ffefafbbd27fe944af3f8ea13d09c6.zip
common-b9295261c1ffefafbbd27fe944af3f8ea13d09c6.tar.gz
common-b9295261c1ffefafbbd27fe944af3f8ea13d09c6.tar.bz2
Merge "kernel: workqueue: avoid process_one_work NULL reference[1/1]" into ampere-20171227
Diffstat
-rw-r--r--kernel/workqueue.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 296dcca..10ec9c3 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2012,11 +2012,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
@@ -2029,6 +2038,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);