mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +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
1 changed files with 3 additions and 1 deletions
|
@ -280,8 +280,10 @@ int br_add_bridge(const char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = register_netdevice(dev);
|
ret = register_netdevice(dev);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
free_netdev(dev);
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
ret = br_sysfs_addbr(dev);
|
ret = br_sysfs_addbr(dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
Loading…
Reference in a new issue