Skip to content

Commit c2e1968

Browse files
committed
af_unix: call proto_unregister() in the error path in af_unix_init()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2164865 Upstream Status: net.git commit 73e341e commit 73e341e Author: Yang Yingliang <yangyingliang@huawei.com> Date: Thu Dec 8 23:01:58 2022 +0800 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: 94531cf ("af_unix: Add unix_stream_proto for sockmap") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Davide Caratti <dcaratti@redhat.com>
1 parent a3674bb commit c2e1968

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/unix/af_unix.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3512,6 +3512,7 @@ static int __init af_unix_init(void)
35123512
rc = proto_register(&unix_stream_proto, 1);
35133513
if (rc != 0) {
35143514
pr_crit("%s: Cannot create unix_sock SLAB cache!\n", __func__);
3515+
proto_unregister(&unix_dgram_proto);
35153516
goto out;
35163517
}
35173518

0 commit comments

Comments
 (0)