diff options
author | David S. Miller <davem@davemloft.net> | 2021-04-26 21:00:00 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-04-26 21:00:00 +0200 |
commit | 6876a18d3361e1893187970e1881a1d88d894d3f (patch) | |
tree | c79dfb4843b82d9346cae1dce68d9b1cfece1715 /drivers/net/bonding/bond_main.c | |
parent | Merge branch 'bnxt_en-next' (diff) | |
parent | bnxt_en: Fix RX consumer index logic in the error path. (diff) | |
download | linux-6876a18d3361e1893187970e1881a1d88d894d3f.tar.xz linux-6876a18d3361e1893187970e1881a1d88d894d3f.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index d5ca38aa8aa9..20bbda1b36e1 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -4391,9 +4391,7 @@ int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave) int agg_id = 0; int ret = 0; -#ifdef CONFIG_LOCKDEP - WARN_ON(lockdep_is_held(&bond->mode_lock)); -#endif + might_sleep(); usable_slaves = kzalloc(struct_size(usable_slaves, arr, bond->slave_cnt), GFP_KERNEL); @@ -4406,7 +4404,9 @@ int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave) if (BOND_MODE(bond) == BOND_MODE_8023AD) { struct ad_info ad_info; + spin_lock_bh(&bond->mode_lock); if (bond_3ad_get_active_agg_info(bond, &ad_info)) { + spin_unlock_bh(&bond->mode_lock); pr_debug("bond_3ad_get_active_agg_info failed\n"); /* No active aggragator means it's not safe to use * the previous array. @@ -4414,6 +4414,7 @@ int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave) bond_reset_slave_arr(bond); goto out; } + spin_unlock_bh(&bond->mode_lock); agg_id = ad_info.aggregator_id; } bond_for_each_slave(bond, slave, iter) { |