aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/bonding/bond_3ad.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index b49f421346a7..cce1f1bf90b4 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -678,6 +678,8 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
678/** 678/**
679 * __get_active_agg - get the current active aggregator 679 * __get_active_agg - get the current active aggregator
680 * @aggregator: the aggregator we're looking at 680 * @aggregator: the aggregator we're looking at
681 *
682 * Caller must hold RCU lock.
681 */ 683 */
682static struct aggregator *__get_active_agg(struct aggregator *aggregator) 684static struct aggregator *__get_active_agg(struct aggregator *aggregator)
683{ 685{
@@ -685,13 +687,9 @@ static struct aggregator *__get_active_agg(struct aggregator *aggregator)
685 struct list_head *iter; 687 struct list_head *iter;
686 struct slave *slave; 688 struct slave *slave;
687 689
688 rcu_read_lock();
689 bond_for_each_slave_rcu(bond, slave, iter) 690 bond_for_each_slave_rcu(bond, slave, iter)
690 if (SLAVE_AD_INFO(slave).aggregator.is_active) { 691 if (SLAVE_AD_INFO(slave).aggregator.is_active)
691 rcu_read_unlock();
692 return &(SLAVE_AD_INFO(slave).aggregator); 692 return &(SLAVE_AD_INFO(slave).aggregator);
693 }
694 rcu_read_unlock();
695 693
696 return NULL; 694 return NULL;
697} 695}
@@ -1499,11 +1497,11 @@ static void ad_agg_selection_logic(struct aggregator *agg)
1499 struct slave *slave; 1497 struct slave *slave;
1500 struct port *port; 1498 struct port *port;
1501 1499
1500 rcu_read_lock();
1502 origin = agg; 1501 origin = agg;
1503 active = __get_active_agg(agg); 1502 active = __get_active_agg(agg);
1504 best = (active && agg_device_up(active)) ? active : NULL; 1503 best = (active && agg_device_up(active)) ? active : NULL;
1505 1504
1506 rcu_read_lock();
1507 bond_for_each_slave_rcu(bond, slave, iter) { 1505 bond_for_each_slave_rcu(bond, slave, iter) {
1508 agg = &(SLAVE_AD_INFO(slave).aggregator); 1506 agg = &(SLAVE_AD_INFO(slave).aggregator);
1509 1507