File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -3930,6 +3930,12 @@ static int bond_open(struct net_device *bond_dev)
3930
3930
struct list_head * iter ;
3931
3931
struct slave * slave ;
3932
3932
3933
+ if (BOND_MODE (bond ) == BOND_MODE_ROUNDROBIN && !bond -> rr_tx_counter ) {
3934
+ bond -> rr_tx_counter = alloc_percpu (u32 );
3935
+ if (!bond -> rr_tx_counter )
3936
+ return - ENOMEM ;
3937
+ }
3938
+
3933
3939
/* reset slave->backup and slave->inactive */
3934
3940
if (bond_has_slaves (bond )) {
3935
3941
bond_for_each_slave (bond , slave , iter ) {
@@ -5907,15 +5913,6 @@ static int bond_init(struct net_device *bond_dev)
5907
5913
if (!bond -> wq )
5908
5914
return - ENOMEM ;
5909
5915
5910
- if (BOND_MODE (bond ) == BOND_MODE_ROUNDROBIN ) {
5911
- bond -> rr_tx_counter = alloc_percpu (u32 );
5912
- if (!bond -> rr_tx_counter ) {
5913
- destroy_workqueue (bond -> wq );
5914
- bond -> wq = NULL ;
5915
- return - ENOMEM ;
5916
- }
5917
- }
5918
-
5919
5916
spin_lock_init (& bond -> stats_lock );
5920
5917
netdev_lockdep_set_classes (bond_dev );
5921
5918
You can’t perform that action at this time.
0 commit comments