summaryrefslogtreecommitdiffstats
path: root/net/9p
diff options
context:
space:
mode:
authorAl Viro <viro@ZenIV.linux.org.uk>2017-12-06 00:29:09 +0100
committerDavid S. Miller <davem@davemloft.net>2017-12-06 00:39:29 +0100
commit8e1611e2357927b22892ecc062d65c99d0d89066 (patch)
treee96c21ce49a9bb3225e8334f87a64dcd14162a75 /net/9p
parentsocketpair(): allocate descriptors first (diff)
downloadlinux-8e1611e2357927b22892ecc062d65c99d0d89066.tar.xz
linux-8e1611e2357927b22892ecc062d65c99d0d89066.zip
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>
Diffstat (limited to 'net/9p')
-rw-r--r--net/9p/trans_fd.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 985046ae4231..80f5c79053a4 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -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);
}