--- x/kernel/workqueue.c +++ y/kernel/workqueue.c @@ -2807,7 +2807,6 @@ void __flush_workqueue(struct workqueue_ return; lock_map_acquire(&wq->lockdep_map); - lock_map_release(&wq->lockdep_map); mutex_lock(&wq->mutex); @@ -2867,7 +2866,7 @@ void __flush_workqueue(struct workqueue_ * handling overflow. Non-first flushers can simply return. */ if (READ_ONCE(wq->first_flusher) != &this_flusher) - return; + goto out; mutex_lock(&wq->mutex); @@ -2942,6 +2941,8 @@ void __flush_workqueue(struct workqueue_ out_unlock: mutex_unlock(&wq->mutex); +out: + lock_map_release(&wq->lockdep_map); } EXPORT_SYMBOL(__flush_workqueue);