diff options
author | Mark Brown <broonie@kernel.org> | 2023-03-13 13:20:33 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-03-13 13:20:33 +0000 |
commit | 32ef0f1a7f01b1832e108380bb2178270058f1f6 (patch) | |
tree | 2cd158f24918882628eae2809f5aa51965927c63 /net/socket.c | |
parent | 2d2998b84330899bf88a0414f3356869be4a69eb (diff) | |
parent | eeac8ede17557680855031c6f305ece2378af326 (diff) |
Merge tag 'v6.3-rc2' into asoc-6.4 to fix clock related boot issues
Linux 6.3-rc2
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/net/socket.c b/net/socket.c index 6bae8ce7059e..9c92c0e6c4da 100644 --- a/net/socket.c +++ b/net/socket.c @@ -450,7 +450,9 @@ static struct file_system_type sock_fs_type = { * * Returns the &file bound with @sock, implicitly storing it * in sock->file. If dname is %NULL, sets to "". - * On failure the return is a ERR pointer (see linux/err.h). + * + * On failure @sock is released, and an ERR pointer is returned. + * * This function uses GFP_KERNEL internally. */ @@ -1638,7 +1640,6 @@ static struct socket *__sys_socket_create(int family, int type, int protocol) struct file *__sys_socket_file(int family, int type, int protocol) { struct socket *sock; - struct file *file; int flags; sock = __sys_socket_create(family, type, protocol); @@ -1649,11 +1650,7 @@ struct file *__sys_socket_file(int family, int type, int protocol) if (SOCK_NONBLOCK != O_NONBLOCK && (flags & SOCK_NONBLOCK)) flags = (flags & ~SOCK_NONBLOCK) | O_NONBLOCK; - file = sock_alloc_file(sock, flags, NULL); - if (IS_ERR(file)) - sock_release(sock); - - return file; + return sock_alloc_file(sock, flags, NULL); } int __sys_socket(int family, int type, int protocol) |