diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-05-04 20:57:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-04 20:57:29 -0400 |
commit | c37aa90b0458d87342e0bb083f6bf7d113220d09 (patch) | |
tree | 1df16515edbc53dc2d3515f95846169d9326b9d7 | |
parent | be0c007ac64f880a946995d6d1fc654acc81484d (diff) |
bridge: Net device leak in br_add_bridge().
In case the register_netdevice() call fails the device is leaked,
since the out: label is just rtnl_unlock()+return.
Free the device.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/bridge/br_if.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 77a981a1ee52..bff0f5bb12be 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -280,8 +280,10 @@ int br_add_bridge(const char *name) | |||
280 | } | 280 | } |
281 | 281 | ||
282 | ret = register_netdevice(dev); | 282 | ret = register_netdevice(dev); |
283 | if (ret) | 283 | if (ret) { |
284 | free_netdev(dev); | ||
284 | goto out; | 285 | goto out; |
286 | } | ||
285 | 287 | ||
286 | ret = br_sysfs_addbr(dev); | 288 | ret = br_sysfs_addbr(dev); |
287 | if (ret) | 289 | if (ret) |