aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@gmail.com>2014-07-16 12:32:01 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-17 19:06:52 -0400
commit14056e7930761b730e2b34ae716e151ba890f3bf (patch)
tree8a8323db360761f0f456861f66895b115177bcda /drivers/net/bonding
parentc104178dda67c9d8de763e0baa60a00d10d9a839 (diff)
bonding: use rtnl_deref in bond_change_rx_flags()
As it's always called with RTNL held, via dev_set_allmulti/promiscuity. Also, remove the wrong comment. CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@gmail.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a2c4e8d4a955..5e5b3b30c51c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -496,9 +496,8 @@ static int bond_set_promiscuity(struct bonding *bond, int inc)
496 int err = 0; 496 int err = 0;
497 497
498 if (bond_uses_primary(bond)) { 498 if (bond_uses_primary(bond)) {
499 struct slave *curr_active = bond_deref_active_protected(bond); 499 struct slave *curr_active = rtnl_dereference(bond->curr_active_slave);
500 500
501 /* write lock already acquired */
502 if (curr_active) 501 if (curr_active)
503 err = dev_set_promiscuity(curr_active->dev, inc); 502 err = dev_set_promiscuity(curr_active->dev, inc);
504 } else { 503 } else {
@@ -522,9 +521,8 @@ static int bond_set_allmulti(struct bonding *bond, int inc)
522 int err = 0; 521 int err = 0;
523 522
524 if (bond_uses_primary(bond)) { 523 if (bond_uses_primary(bond)) {
525 struct slave *curr_active = bond_deref_active_protected(bond); 524 struct slave *curr_active = rtnl_dereference(bond->curr_active_slave);
526 525
527 /* write lock already acquired */
528 if (curr_active) 526 if (curr_active)
529 err = dev_set_allmulti(curr_active->dev, inc); 527 err = dev_set_allmulti(curr_active->dev, inc);
530 } else { 528 } else {