@@ -5612,9 +5612,9 @@ static void wq_adjust_max_active(struct workqueue_struct *wq)
5612
5612
}
5613
5613
5614
5614
__printf (1 , 4 )
5615
- struct workqueue_struct * alloc_workqueue (const char * fmt ,
5616
- unsigned int flags ,
5617
- int max_active , ...)
5615
+ static struct workqueue_struct * __alloc_workqueue (const char * fmt ,
5616
+ unsigned int flags ,
5617
+ int max_active , ...)
5618
5618
{
5619
5619
va_list args ;
5620
5620
struct workqueue_struct * wq ;
@@ -5680,12 +5680,11 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
5680
5680
INIT_LIST_HEAD (& wq -> flusher_overflow );
5681
5681
INIT_LIST_HEAD (& wq -> maydays );
5682
5682
5683
- wq_init_lockdep (wq );
5684
5683
INIT_LIST_HEAD (& wq -> list );
5685
5684
5686
5685
if (flags & WQ_UNBOUND ) {
5687
5686
if (alloc_node_nr_active (wq -> node_nr_active ) < 0 )
5688
- goto err_unreg_lockdep ;
5687
+ goto err_free_wq ;
5689
5688
}
5690
5689
5691
5690
/*
@@ -5724,9 +5723,6 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
5724
5723
kthread_flush_worker (pwq_release_worker );
5725
5724
free_node_nr_active (wq -> node_nr_active );
5726
5725
}
5727
- err_unreg_lockdep :
5728
- wq_unregister_lockdep (wq );
5729
- wq_free_lockdep (wq );
5730
5726
err_free_wq :
5731
5727
free_workqueue_attrs (wq -> unbound_attrs );
5732
5728
kfree (wq );
@@ -5737,6 +5733,25 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
5737
5733
destroy_workqueue (wq );
5738
5734
return NULL ;
5739
5735
}
5736
+
5737
+ __printf (1 , 4 )
5738
+ struct workqueue_struct * alloc_workqueue (const char * fmt ,
5739
+ unsigned int flags ,
5740
+ int max_active , ...)
5741
+ {
5742
+ struct workqueue_struct * wq ;
5743
+ va_list args ;
5744
+
5745
+ va_start (args , max_active );
5746
+ wq = __alloc_workqueue (fmt , flags , max_active , args );
5747
+ va_end (args );
5748
+ if (!wq )
5749
+ return NULL ;
5750
+
5751
+ wq_init_lockdep (wq );
5752
+
5753
+ return wq ;
5754
+ }
5740
5755
EXPORT_SYMBOL_GPL (alloc_workqueue );
5741
5756
5742
5757
static bool pwq_busy (struct pool_workqueue * pwq )
0 commit comments