]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
bonding: use rtnl_deref in bond_change_rx_flags()
authorVeaceslav Falico <vfalico@gmail.com>
Wed, 16 Jul 2014 16:32:01 +0000 (18:32 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jul 2014 23:06:52 +0000 (16:06 -0700)
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>
drivers/net/bonding/bond_main.c

index a2c4e8d4a9559fbdfa7806d9cbcceb76d7a29975..5e5b3b30c51c2f1ba4786d1104dfa96bee85de85 100644 (file)
@@ -496,9 +496,8 @@ static int bond_set_promiscuity(struct bonding *bond, int inc)
        int err = 0;
 
        if (bond_uses_primary(bond)) {
-               struct slave *curr_active = bond_deref_active_protected(bond);
+               struct slave *curr_active = rtnl_dereference(bond->curr_active_slave);
 
-               /* write lock already acquired */
                if (curr_active)
                        err = dev_set_promiscuity(curr_active->dev, inc);
        } else {
@@ -522,9 +521,8 @@ static int bond_set_allmulti(struct bonding *bond, int inc)
        int err = 0;
 
        if (bond_uses_primary(bond)) {
-               struct slave *curr_active = bond_deref_active_protected(bond);
+               struct slave *curr_active = rtnl_dereference(bond->curr_active_slave);
 
-               /* write lock already acquired */
                if (curr_active)
                        err = dev_set_allmulti(curr_active->dev, inc);
        } else {