bonding: vlans don't get deleted on enslave failure
authornikolay@redhat.com <nikolay@redhat.com>
Thu, 18 Apr 2013 07:33:35 +0000 (07:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Apr 2013 21:48:18 +0000 (17:48 -0400)
The main problem is with vid refcount which only gets bumped up.
Delete the vlans after err_detach as that's the first error path
after the vlans are added.

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_main.c

index 4cecb80df854524d5781760050b352dd5c70e61b..dd67c49070d7f372501a6b2b7bfd73931bdf3b5a 100644 (file)
@@ -1906,6 +1906,7 @@ err_detach:
                bond_mc_list_flush(bond_dev, slave_dev);
                netif_addr_unlock_bh(bond_dev);
        }
+       bond_del_vlans_from_slave(bond, slave_dev);
        write_lock_bh(&bond->lock);
        bond_detach_slave(bond, new_slave);
        write_unlock_bh(&bond->lock);