af_unix: call proto_unregister() in the error path in af_unix_init()
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 8 Dec 2022 15:01:58 +0000 (23:01 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Dec 2022 10:04:08 +0000 (10:04 +0000)
commit73e341e0281a35274629e9be27eae2f9b1b492bf
treeaa3e882567dbde29220b9e06b9ae73842a60a0eb
parent526682b458b1b56d2e0db027df535cb5cdcfde59
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: 94531cfcbe79 ("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>
net/unix/af_unix.c