summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2026-08-12 09:03:20 -0700
committerTejun Heo <tj@kernel.org>2026-08-12 07:14:22 -1000
commit4e0ee51cc2b7a542e5679edaa14aaa82be3b4abb (patch)
tree9876593281379cacdd6d337f5dde51e764e76a08
parent1d125f0e6cbd34f6260affac85987201b6899ed0 (diff)
downloadlinux-stable-4e0ee51cc2b7a542e5679edaa14aaa82be3b4abb.tar.gz
linux-stable-4e0ee51cc2b7a542e5679edaa14aaa82be3b4abb.zip
workqueue: BUG_ON() instead of returning NULL in wq_node_nr_active()
wq_node_nr_active() warns and returns NULL when @wq is not unbound, but every caller dereferences the result right away, so the WARN_ON_ONCE() only moves the oops one frame up, as raised by Tejun. Fix it by BUGing_ON() instead of this silly WARN_ON_ONCE(); Fixes: b72fdc651056 ("workqueue: account nr_active by the backing pool") Suggested-by: Tejun Heo <tj@kernel.org> Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--kernel/workqueue.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index e602ab2049a7..d4ad5d93e1a7 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1625,8 +1625,7 @@ static bool is_percpu_pool(struct worker_pool *pool)
static struct wq_node_nr_active *wq_node_nr_active(struct workqueue_struct *wq,
int node)
{
- if (WARN_ON_ONCE(!(wq->flags & WQ_UNBOUND)))
- return NULL;
+ BUG_ON(!(wq->flags & WQ_UNBOUND));
if (node == NUMA_NO_NODE)
node = nr_node_ids;