Commit 8d6184e4 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

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: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3729d502
......@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment