Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78121
b: refs/heads/master
c: de0fa95
h: refs/heads/master
i:
  78119: 6cc53ba
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Jan 28, 2008
1 parent 7075124 commit 5671288
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 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: 62013dbb8418eb7231c1577d238cf2e76b7696b0
refs/heads/master: de0fa95c14bc4d4b545fae26439371ebfdcb8534
25 changes: 7 additions & 18 deletions trunk/net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1594,16 +1594,11 @@ asmlinkage long sys_sendto(int fd, void __user *buff, size_t len,
struct msghdr msg;
struct iovec iov;
int fput_needed;
struct file *sock_file;

sock_file = fget_light(fd, &fput_needed);
err = -EBADF;
if (!sock_file)
sock = sockfd_lookup_light(fd, &err, &fput_needed);
if (!sock)
goto out;

sock = sock_from_file(sock_file, &err);
if (!sock)
goto out_put;
iov.iov_base = buff;
iov.iov_len = len;
msg.msg_name = NULL;
Expand All @@ -1625,7 +1620,7 @@ asmlinkage long sys_sendto(int fd, void __user *buff, size_t len,
err = sock_sendmsg(sock, &msg, len);

out_put:
fput_light(sock_file, fput_needed);
fput_light(sock->file, fput_needed);
out:
return err;
}
Expand Down Expand Up @@ -1654,17 +1649,11 @@ asmlinkage long sys_recvfrom(int fd, void __user *ubuf, size_t size,
struct msghdr msg;
char address[MAX_SOCK_ADDR];
int err, err2;
struct file *sock_file;
int fput_needed;

sock_file = fget_light(fd, &fput_needed);
err = -EBADF;
if (!sock_file)
goto out;

sock = sock_from_file(sock_file, &err);
sock = sockfd_lookup_light(fd, &err, &fput_needed);
if (!sock)
goto out_put;
goto out;

msg.msg_control = NULL;
msg.msg_controllen = 0;
Expand All @@ -1683,8 +1672,8 @@ asmlinkage long sys_recvfrom(int fd, void __user *ubuf, size_t size,
if (err2 < 0)
err = err2;
}
out_put:
fput_light(sock_file, fput_needed);

fput_light(sock->file, fput_needed);
out:
return err;
}
Expand Down

0 comments on commit 5671288

Please sign in to comment.