mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
af_unix: call proto_unregister() in the error path in af_unix_init()
[ Upstream commit73e341e028
] If register unix_stream_proto returns error, unix_dgram_proto needs be unregistered. Fixes:94531cfcbe
("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>
This commit is contained in:
parent
ee9d03bf89
commit
d436bf39f4
1 changed files with 1 additions and 0 deletions
|
@ -3401,6 +3401,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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue