diff options
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/socket.c b/net/socket.c index 9566e57ac7f5..ea8f81abc45c 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1381,7 +1381,7 @@ asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, | |||
1381 | 1381 | ||
1382 | err = sock_attach_fd(newsock, newfile); | 1382 | err = sock_attach_fd(newsock, newfile); |
1383 | if (err < 0) | 1383 | if (err < 0) |
1384 | goto out_fd; | 1384 | goto out_fd_simple; |
1385 | 1385 | ||
1386 | err = security_socket_accept(sock, newsock); | 1386 | err = security_socket_accept(sock, newsock); |
1387 | if (err) | 1387 | if (err) |
@@ -1414,6 +1414,11 @@ out_put: | |||
1414 | fput_light(sock->file, fput_needed); | 1414 | fput_light(sock->file, fput_needed); |
1415 | out: | 1415 | out: |
1416 | return err; | 1416 | return err; |
1417 | out_fd_simple: | ||
1418 | sock_release(newsock); | ||
1419 | put_filp(newfile); | ||
1420 | put_unused_fd(newfd); | ||
1421 | goto out_put; | ||
1417 | out_fd: | 1422 | out_fd: |
1418 | fput(newfile); | 1423 | fput(newfile); |
1419 | put_unused_fd(newfd); | 1424 | put_unused_fd(newfd); |