mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
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>
This commit is contained in:
parent
be0c007ac6
commit
c37aa90b04
@ -280,8 +280,10 @@ int br_add_bridge(const char *name)
|
||||
}
|
||||
|
||||
ret = register_netdevice(dev);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
free_netdev(dev);
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = br_sysfs_addbr(dev);
|
||||
if (ret)
|
||||
|
Loading…
Reference in New Issue
Block a user