aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/workqueue_internal.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/workqueue_internal.h b/kernel/workqueue_internal.h
index efdd72e15794..d390d1be3748 100644
--- a/kernel/workqueue_internal.h
+++ b/kernel/workqueue_internal.h
@@ -10,6 +10,7 @@
10 10
11#include <linux/workqueue.h> 11#include <linux/workqueue.h>
12#include <linux/kthread.h> 12#include <linux/kthread.h>
13#include <linux/preempt.h>
13 14
14struct worker_pool; 15struct worker_pool;
15 16
@@ -60,7 +61,7 @@ struct worker {
60 */ 61 */
61static inline struct worker *current_wq_worker(void) 62static inline struct worker *current_wq_worker(void)
62{ 63{
63 if (current->flags & PF_WQ_WORKER) 64 if (in_task() && (current->flags & PF_WQ_WORKER))
64 return kthread_data(current); 65 return kthread_data(current);
65 return NULL; 66 return NULL;
66} 67}