summaryrefslogtreecommitdiff
path: root/net/socket.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2023-03-13 16:21:01 +0300
committerMark Brown <broonie@kernel.org>2023-03-13 16:21:01 +0300
commitc938bb0cf644a61cc6222cc6d0f106bb5c4b4ff5 (patch)
tree22e62a91a4674df9043d298994a27acc11830044 /net/socket.c
parent7d4ae72edba715d8e2dbfb3851879d354d13a7b9 (diff)
parenteeac8ede17557680855031c6f305ece2378af326 (diff)
downloadlinux-c938bb0cf644a61cc6222cc6d0f106bb5c4b4ff5.tar.xz
Merge tag 'v6.3-rc2' into spi-6.4 to fix clock related boot issues
Linux 6.3-rc2
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c11
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)