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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:19 +0000 (13:14 +0100)
commitd436bf39f47b27681c7925c65cad93db3d043694
treecbb1c4ac25be2f95b8212aabde237f8507f9c0d5
parentee9d03bf8907addf0a66effba42bb29e7b55ef1a
af_unix: call proto_unregister() in the error path in af_unix_init()

[ Upstream commit 73e341e0281a35274629e9be27eae2f9b1b492bf ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/unix/af_unix.c