diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2017-12-05 23:29:09 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-05 18:39:29 -0500 |
commit | 8e1611e2357927b22892ecc062d65c99d0d89066 (patch) | |
tree | e96c21ce49a9bb3225e8334f87a64dcd14162a75 /net/sctp | |
parent | 016a266bdfeda268afb2228b6217fd4771334635 (diff) | |
download | linux-8e1611e2357927b22892ecc062d65c99d0d89066.tar.bz2 |
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/sctp')
-rw-r--r-- | net/sctp/socket.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 014847e25648..eb17a911aa29 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -5080,7 +5080,6 @@ static int sctp_getsockopt_peeloff_common(struct sock *sk, sctp_peeloff_arg_t *p *newfile = sock_alloc_file(newsock, 0, NULL); if (IS_ERR(*newfile)) { put_unused_fd(retval); - sock_release(newsock); retval = PTR_ERR(*newfile); *newfile = NULL; return retval; |