Skip to content

Commit

Permalink
bridge: Consolidate error paths in br_add_bridge().
Browse files Browse the repository at this point in the history
This actually had to be merged with the patch #1, but I decided not to
mix two changes in one patch.

There are already two calls to free_netdev() in there, so merge them
into one.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed May 5, 2008
1 parent c37aa90 commit e340a90
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions net/bridge/br_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,24 +273,24 @@ int br_add_bridge(const char *name)
rtnl_lock();
if (strchr(dev->name, '%')) {
ret = dev_alloc_name(dev, dev->name);
if (ret < 0) {
free_netdev(dev);
goto out;
}
if (ret < 0)
goto out_free;
}

ret = register_netdevice(dev);
if (ret) {
free_netdev(dev);
goto out;
}
if (ret)
goto out_free;

ret = br_sysfs_addbr(dev);
if (ret)
unregister_netdevice(dev);
out:
rtnl_unlock();
return ret;

out_free:
free_netdev(dev);
goto out;
}

int br_del_bridge(const char *name)
Expand Down

0 comments on commit e340a90

Please sign in to comment.