forked from luck/tmp_suning_uos_patched
bonding: fix device leak on error in bond_create()
When the register_netdevice() call fails, the newly allocated device is not freed. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3729d50212
commit
8d6184e488
@ -4946,6 +4946,8 @@ int bond_create(struct net *net, const char *name)
|
||||
}
|
||||
|
||||
res = register_netdevice(bond_dev);
|
||||
if (res < 0)
|
||||
goto out_netdev;
|
||||
|
||||
out:
|
||||
rtnl_unlock();
|
||||
|
Loading…
Reference in New Issue
Block a user