SUNRPC: Fix error handling in svc_setup_socket()
Dan points out that sock_alloc_file() releases @sock on error, but so do all of svc_setup_socket's callers, resulting in a double- release if sock_alloc_file() returns an error. Rather than allocating a struct file for all new sockets, allocate one only for sockets created during a TCP accept. For the moment, those are the only ones that will ever be used with RPC-with-TLS. Reported-by: NDan Carpenter <dan.carpenter@linaro.org> Fixes: ae0d7770 ("SUNRPC: Ensure server-side sockets have a sock->file") Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
Showing
想要评论请 注册 或 登录