Skip to content

Commit

Permalink
bonding: fix device leak on error in bond_create()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Feb 27, 2010
1 parent 3729d50 commit 8d6184e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 8d6184e

Please sign in to comment.