Skip to content
Commit 319050d4 authored by Chuck Lever's avatar Chuck Lever
Browse files

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: default avatarDan Carpenter <dan.carpenter@linaro.org>
Fixes: ae0d7770

 ("SUNRPC: Ensure server-side sockets have a sock->file")
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 29cd2927
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment