Commit 73e341e0 authored by Yang Yingliang's avatar Yang Yingliang Committed by David S. Miller
Browse files

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: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 526682b4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}