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:
Pavel Emelyanov 2008-05-04 17:57:29 -07:00 committed by David S. Miller
parent be0c007ac6
commit c37aa90b04

View File

@ -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)