From: Stephen Hemminger Date: Fri, 12 Jun 2009 19:02:45 +0000 (+0000) Subject: bonding: initialize before registration X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d93216051ae60995736518ca9ebb58a0e6ade212;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git bonding: initialize before registration Avoid a unnecessary carrier state transistion that happens when device is registered. Lockdep works better if initialization is done before registration as well. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index a1fa8deb254..99ddd283e15 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -5164,15 +5164,15 @@ int bond_create(const char *name) goto out_netdev; } + bond_set_lockdep_class(bond_dev); + + netif_carrier_off(bond_dev); + res = register_netdevice(bond_dev); if (res < 0) { goto out_bond; } - bond_set_lockdep_class(bond_dev); - - netif_carrier_off(bond_dev); - up_write(&bonding_rwsem); rtnl_unlock(); /* allows sysfs registration of net device */ res = bond_create_sysfs_entry(netdev_priv(bond_dev));