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)
39303930 struct list_head * iter ;
39313931 struct slave * slave ;
39323932
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+
39333939 /* reset slave->backup and slave->inactive */
39343940 if (bond_has_slaves (bond )) {
39353941 bond_for_each_slave (bond , slave , iter ) {
@@ -5907,15 +5913,6 @@ static int bond_init(struct net_device *bond_dev)
59075913 if (!bond -> wq )
59085914 return - ENOMEM ;
59095915
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-
59195916 spin_lock_init (& bond -> stats_lock );
59205917 netdev_lockdep_set_classes (bond_dev );
59215918
You can’t perform that action at this time.
0 commit comments