Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177385
b: refs/heads/master
c: 198de4d
h: refs/heads/master
i:
  177383: 3752aaf
v: v3
  • Loading branch information
Al Viro committed Dec 16, 2009
1 parent a365211 commit 419cf3b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 732741274d0269718ba20c520cf72530bb038641
refs/heads/master: 198de4d7ac3a0f1351c6377ff657950457ed0038
31 changes: 14 additions & 17 deletions trunk/net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1396,23 +1396,30 @@ SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol,
goto out_release_both;
}

fd2 = sock_alloc_fd(&newfile2, flags & O_CLOEXEC);
if (unlikely(fd2 < 0)) {
err = fd2;
err = sock_attach_fd(sock1, newfile1, flags & O_NONBLOCK);
if (unlikely(err < 0)) {
put_filp(newfile1);
put_unused_fd(fd1);
goto out_release_both;
}

err = sock_attach_fd(sock1, newfile1, flags & O_NONBLOCK);
if (unlikely(err < 0)) {
goto out_fd2;
fd2 = sock_alloc_fd(&newfile2, flags & O_CLOEXEC);
if (unlikely(fd2 < 0)) {
err = fd2;
fput(newfile1);
put_unused_fd(fd1);
sock_release(sock2);
goto out;
}

err = sock_attach_fd(sock2, newfile2, flags & O_NONBLOCK);
if (unlikely(err < 0)) {
put_filp(newfile2);
put_unused_fd(fd2);
fput(newfile1);
goto out_fd1;
put_unused_fd(fd1);
sock_release(sock2);
goto out;
}

audit_fd_pair(fd1, fd2);
Expand All @@ -1438,16 +1445,6 @@ SYSCALL_DEFINE4(socketpair, int, family, int, type, int, protocol,
sock_release(sock1);
out:
return err;

out_fd2:
put_filp(newfile1);
sock_release(sock1);
out_fd1:
put_filp(newfile2);
sock_release(sock2);
put_unused_fd(fd1);
put_unused_fd(fd2);
goto out;
}

/*
Expand Down

0 comments on commit 419cf3b

Please sign in to comment.