mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-05 08:44:14 +02:00
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: b72fdc6510 ("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>
This commit is contained in:
+1
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user