make sock_alloc_file() do sock_release() on failures
This changes calling conventions (and simplifies the hell out the callers). New rules: once struct socket had been passed to sock_alloc_file(), it's been consumed either by struct file or by sock_release() done by sock_alloc_file(). Either way the caller should not do sock_release() after that point. Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -839,7 +839,6 @@ static int p9_socket_open(struct p9_client *client, struct socket *csocket)
|
||||
if (IS_ERR(file)) {
|
||||
pr_err("%s (%d): failed to map fd\n",
|
||||
__func__, task_pid_nr(current));
|
||||
sock_release(csocket);
|
||||
kfree(p);
|
||||
return PTR_ERR(file);
|
||||
}
|
||||
|
Reference in New Issue
Block a user