[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221210125923.47456-1-kuniyu@amazon.com>
Date: Sat, 10 Dec 2022 21:59:23 +0900
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <yangyingliang@...wei.com>
CC: <andrii@...nel.org>, <davem@...emloft.net>, <edumazet@...gle.com>,
<jakub@...udflare.com>, <jiang.wang@...edance.com>,
<john.fastabend@...il.com>, <kuba@...nel.org>,
<netdev@...r.kernel.org>, <pabeni@...hat.com>,
Kuniyuki Iwashima <kuniyu@...zon.com>
Subject: Re: [PATCH net] af_unix: call proto_unregister() in the error path in af_unix_init()
From: Yang Yingliang <yangyingliang@...wei.com>
Date: Thu, 8 Dec 2022 23:01:58 +0800
> 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@...wei.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@...zon.com>
Thanks for the patch.
It's rare though, sock_register() and register_pernet_subsys() also could
fail, and it will need another Fixes tag, so I'll send a follow-up patch
after this is merged.
> ---
> net/unix/af_unix.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index b3545fc68097..ede2b2a140a4 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -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;
> }
>
> --
> 2.25.1
Powered by blists - more mailing lists