summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-03-04 05:48:18 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2014-03-10 16:44:41 +0100
commit00e188ef6a7e7bf2883bcffc30d89e98a0bb76b3 (patch)
tree10d8312d1061a412825169ef1227c4933767a2c2
parentvfs: atomic f_pos accesses as per POSIX (diff)
downloadlinux-00e188ef6a7e7bf2883bcffc30d89e98a0bb76b3.tar.xz
linux-00e188ef6a7e7bf2883bcffc30d89e98a0bb76b3.zip
sockfd_lookup_light(): switch to fdget^W^Waway from fget_light
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--net/socket.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/socket.c b/net/socket.c
index 879933aaed4c..fd8d86e06f95 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -450,16 +450,17 @@ EXPORT_SYMBOL(sockfd_lookup);
static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed)
{
- struct file *file;
+ struct fd f = fdget(fd);
struct socket *sock;
*err = -EBADF;
- file = fget_light(fd, fput_needed);
- if (file) {
- sock = sock_from_file(file, err);
- if (sock)
+ if (f.file) {
+ sock = sock_from_file(f.file, err);
+ if (likely(sock)) {
+ *fput_needed = f.flags;
return sock;
- fput_light(file, *fput_needed);
+ }
+ fdput(f);
}
return NULL;
}