diff options
Diffstat (limited to 'net/bridge/br_if.c')
-rw-r--r-- | net/bridge/br_if.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 77a981a1ee52..c2397f503b0f 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -273,15 +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 | goto out; | 282 | goto out_free; |
285 | 283 | ||
286 | ret = br_sysfs_addbr(dev); | 284 | ret = br_sysfs_addbr(dev); |
287 | if (ret) | 285 | if (ret) |
@@ -289,6 +287,10 @@ int br_add_bridge(const char *name) | |||
289 | out: | 287 | out: |
290 | rtnl_unlock(); | 288 | rtnl_unlock(); |
291 | return ret; | 289 | return ret; |
290 | |||
291 | out_free: | ||
292 | free_netdev(dev); | ||
293 | goto out; | ||
292 | } | 294 | } |
293 | 295 | ||
294 | int br_del_bridge(const char *name) | 296 | int br_del_bridge(const char *name) |