diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 4cfcd027e4bf..4f8d72dae0e8 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1663,6 +1663,9 @@ static void worker_detach_from_pool(struct worker *worker, detach_completion = pool->detach_completion; mutex_unlock(&pool->attach_mutex); + /* clear leftover flags without pool->lock after it is detached */ + worker->flags &= ~(WORKER_UNBOUND | WORKER_REBOUND); + if (detach_completion) complete(detach_completion); }