Commit c37aa90b authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

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: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be0c007a
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment