From: Al Viro Date: Tue, 4 Mar 2014 04:48:18 +0000 (-0500) Subject: sockfd_lookup_light(): switch to fdget^W^Waway from fget_light X-Git-Tag: v3.14-rc7~18^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00e188ef6a7e7bf2883bcffc30d89e98a0bb76b3;p=platform%2Fkernel%2Flinux-exynos.git sockfd_lookup_light(): switch to fdget^W^Waway from fget_light Signed-off-by: Al Viro --- diff --git a/net/socket.c b/net/socket.c index 879933a..fd8d86e 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; }