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:
committed by
David S. Miller
parent
3729d50212
commit
8d6184e488
@@ -4946,6 +4946,8 @@ int bond_create(struct net *net, const char *name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
res = register_netdevice(bond_dev);
|
res = register_netdevice(bond_dev);
|
||||||
|
if (res < 0)
|
||||||
|
goto out_netdev;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
|
Reference in New Issue
Block a user