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();
Showing the changes to kernel/workqueue.c (1 of 1 file). Show all
Unified · Split
| @@ -1625,8 +1625,7 @@ static bool is_percpu_pool(struct worker_pool *pool) · 1624 unmodified lines | |||
| 1625 | static struct wq_node_nr_active *wq_node_nr_active(struct workqueue_struct *wq, | 1625 | static struct wq_node_nr_active *wq_node_nr_active(struct workqueue_struct *wq, |
| 1626 | int node) | 1626 | int node) |
| 1627 | { | 1627 | { |
| 1628 | if (WARN_ON_ONCE(!(wq->flags & WQ_UNBOUND))) | 1628 | BUG_ON(!(wq->flags & WQ_UNBOUND)); |
| 1629 | return NULL; | ||
| 1630 | 1629 | ||
| 1631 | if (node == NUMA_NO_NODE) | 1630 | if (node == NUMA_NO_NODE) |
| 1632 | node = nr_node_ids; | 1631 | node = nr_node_ids; |