Skip to content

Commit

Permalink
bonding: use rtnl_deref in bond_change_rx_flags()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Veaceslav Falico authored and David S. Miller committed Jul 17, 2014
1 parent c104178 commit 14056e7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 14056e7

Please sign in to comment.