提交 73e341e0 编写于 作者: Y Yang Yingliang 提交者: David S. Miller

af_unix: call proto_unregister() in the error path in af_unix_init()

If register unix_stream_proto returns error, unix_dgram_proto needs
be unregistered.

Fixes: 94531cfc ("af_unix: Add unix_stream_proto for sockmap")
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NSimon Horman <simon.horman@corigine.com>
Reviewed-by: NKuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 526682b4
......@@ -3738,6 +3738,7 @@ static int __init af_unix_init(void)
rc = proto_register(&unix_stream_proto, 1);
if (rc != 0) {
pr_crit("%s: Cannot create unix_sock SLAB cache!\n", __func__);
proto_unregister(&unix_dgram_proto);
goto out;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册