xen-netfront: Update features after registering netdev
[platform/kernel/linux-rpi.git] / kernel / workqueue_internal.h
index 8635417..d390d1b 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * kernel/workqueue_internal.h
  *
@@ -9,6 +10,7 @@
 
 #include <linux/workqueue.h>
 #include <linux/kthread.h>
+#include <linux/preempt.h>
 
 struct worker_pool;
 
@@ -59,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;
 }