Skip to content

Commit

Permalink
bonding: get netdev_rx_handler_unregister out of locks
Browse files Browse the repository at this point in the history
[ Upstream commit fcd9943 ]

Now that netdev_rx_handler_unregister contains synchronize_net(), we need
to call it outside of bond->lock, cause it might sleep. Also, remove the
already unneded synchronize_net().

Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Veaceslav Falico authored and Greg Kroah-Hartman committed Apr 5, 2013
1 parent 6f44fdd commit 0679dd5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
@@ -1955,12 +1955,11 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
return -EINVAL;
}

write_unlock_bh(&bond->lock);
/* unregister rx_handler early so bond_handle_frame wouldn't be called
* for this slave anymore.
*/
netdev_rx_handler_unregister(slave_dev);
write_unlock_bh(&bond->lock);
synchronize_net();
write_lock_bh(&bond->lock);

if (!bond->params.fail_over_mac) {

0 comments on commit 0679dd5

Please sign in to comment.