workqueue: test WQ_UNBOUND explicitly in the hotplug loops

workqueue_online_cpu() and workqueue_offline_cpu() decide whether a
workqueue needs a pod affinity update by testing wq->unbound_attrs for
NULL, which is only meaningful because the attrs are allocated for
unbound workqueues alone.

Test the flag instead, so the attrs can later be allocated for every
workqueue.

No functional change.

Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Breno Leitao 2026-08-05 07:52:32 -07:00 committed by Tejun Heo
parent b72fdc6510
commit dd55381120

View File

@ -6945,7 +6945,7 @@ int workqueue_online_cpu(unsigned int cpu)
list_for_each_entry(wq, &workqueues, list) {
struct workqueue_attrs *attrs = wq->unbound_attrs;
if (attrs) {
if (wq->flags & WQ_UNBOUND) {
const struct wq_pod_type *pt = wqattrs_pod_type(attrs);
int tcpu;
@ -6980,7 +6980,7 @@ int workqueue_offline_cpu(unsigned int cpu)
list_for_each_entry(wq, &workqueues, list) {
struct workqueue_attrs *attrs = wq->unbound_attrs;
if (attrs) {
if (wq->flags & WQ_UNBOUND) {
const struct wq_pod_type *pt = wqattrs_pod_type(attrs);
int tcpu;