]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
bonding: get netdev_rx_handler_unregister out of locks
authorVeaceslav Falico <vfalico@redhat.com>
Tue, 2 Apr 2013 05:15:16 +0000 (05:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 17:04:52 +0000 (10:04 -0700)
[ Upstream commit fcd99434fb5c137274d2e15dd2a6a7455f0f29ff ]

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>
drivers/net/bonding/bond_main.c

index 76f2718ec454f63900a02efa384b828160d634ad..d9f646f3d9b769aa7aed35d3eebf019c5dbdb442 100644 (file)
@@ -1956,12 +1956,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) {