mirror of
https://github.com/torvalds/linux.git
synced 2026-09-12 20:53:03 +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:
parent
1d125f0e6c
commit
4e0ee51cc2
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user