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 @@ -4182,6 +4182,12 @@ static int bond_open(struct net_device *bond_dev)
41824182 struct list_head * iter ;
41834183 struct slave * slave ;
41844184
4185+ if (BOND_MODE (bond ) == BOND_MODE_ROUNDROBIN && !bond -> rr_tx_counter ) {
4186+ bond -> rr_tx_counter = alloc_percpu (u32 );
4187+ if (!bond -> rr_tx_counter )
4188+ return - ENOMEM ;
4189+ }
4190+
41854191 /* reset slave->backup and slave->inactive */
41864192 if (bond_has_slaves (bond )) {
41874193 bond_for_each_slave (bond , slave , iter ) {
@@ -6243,15 +6249,6 @@ static int bond_init(struct net_device *bond_dev)
62436249 if (!bond -> wq )
62446250 return - ENOMEM ;
62456251
6246- if (BOND_MODE (bond ) == BOND_MODE_ROUNDROBIN ) {
6247- bond -> rr_tx_counter = alloc_percpu (u32 );
6248- if (!bond -> rr_tx_counter ) {
6249- destroy_workqueue (bond -> wq );
6250- bond -> wq = NULL ;
6251- return - ENOMEM ;
6252- }
6253- }
6254-
62556252 spin_lock_init (& bond -> stats_lock );
62566253 netdev_lockdep_set_classes (bond_dev );
62576254
You can’t perform that action at this time.
0 commit comments