diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-05-04 20:58:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-04 20:58:07 -0400 |
commit | e340a90e6e07bba6e6b3fc39dd5fa76f95579d7c (patch) | |
tree | 68f1448c762d217bbed95c49b5da85c1151b278b /net/bridge | |
parent | c37aa90b0458d87342e0bb083f6bf7d113220d09 (diff) |
bridge: Consolidate error paths in br_add_bridge().
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>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_if.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index bff0f5bb12be..c2397f503b0f 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -273,17 +273,13 @@ int br_add_bridge(const char *name) | |||
273 | rtnl_lock(); | 273 | rtnl_lock(); |
274 | if (strchr(dev->name, '%')) { | 274 | if (strchr(dev->name, '%')) { |
275 | ret = dev_alloc_name(dev, dev->name); | 275 | ret = dev_alloc_name(dev, dev->name); |
276 | if (ret < 0) { | 276 | if (ret < 0) |
277 | free_netdev(dev); | 277 | goto out_free; |
278 | goto out; | ||
279 | } | ||
280 | } | 278 | } |
281 | 279 | ||
282 | ret = register_netdevice(dev); | 280 | ret = register_netdevice(dev); |
283 | if (ret) { | 281 | if (ret) |
284 | free_netdev(dev); | 282 | goto out_free; |
285 | goto out; | ||
286 | } | ||
287 | 283 | ||
288 | ret = br_sysfs_addbr(dev); | 284 | ret = br_sysfs_addbr(dev); |
289 | if (ret) | 285 | if (ret) |
@@ -291,6 +287,10 @@ int br_add_bridge(const char *name) | |||
291 | out: | 287 | out: |
292 | rtnl_unlock(); | 288 | rtnl_unlock(); |
293 | return ret; | 289 | return ret; |
290 | |||
291 | out_free: | ||
292 | free_netdev(dev); | ||
293 | goto out; | ||
294 | } | 294 | } |
295 | 295 | ||
296 | int br_del_bridge(const char *name) | 296 | int br_del_bridge(const char *name) |