提交 c37aa90b 编写于 作者: P Pavel Emelyanov 提交者: 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: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册