aboutsummaryrefslogtreecommitdiff
path: root/kernel/workqueue_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/workqueue_internal.h')
-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 f000c4d6917e..42d1e3974554 100644
--- a/kernel/workqueue_internal.h
+++ b/kernel/workqueue_internal.h
@@ -9,6 +9,7 @@
#include <linux/workqueue.h>
#include <linux/kthread.h>
+#include <linux/preempt.h>
struct worker_pool;
@@ -60,7 +61,7 @@ struct worker {
*/
static inline struct worker *current_wq_worker(void)
{
- if (current->flags & PF_WQ_WORKER)
+ if (in_task() && (current->flags & PF_WQ_WORKER))
return kthread_data(current);
return NULL;
}