projects/linux·commit 9fee1f65

Merge tag 'wq-for-7.3-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq

9fee1f65 · Linus Torvalds <[email protected]> · 2026-10-14 16:11:57 -07:00

Pull workqueue fix from Tejun Heo:

 - Fix a NULL dereference in the check for whether the current task is
   running a memory reclaim work item when called from a kworker outside
   work item execution

* tag 'wq-for-7.3-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
  workqueue: Fix NULL current_pwq deref in mem-reclaim helper
Commit
9fee1f650a0a9ea6fa7c0b26244a778dd92542d5
Parents
db7afcbf · d1a4549a

Merge commit. Changes below are compared with the first parent: db7afcbf.

Changes

1 files changed · +1 −1

FileStatusAddDelContent
kernel/workqueue.cmodified+1−1View file

kernel/workqueue.c

View file
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index c56c042..c1cb328 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -6320,7 +6320,7 @@ bool current_is_workqueue_mem_reclaim(void)
{
struct worker *worker = current_wq_worker();
- return worker &&
+ return worker && worker->current_pwq &&
((worker->current_pwq->wq->flags &
(WQ_MEM_RECLAIM | __WQ_LEGACY)) == WQ_MEM_RECLAIM);
}