Skip to content

Commit 00e188e

Browse files
author
Al Viro
committed
sockfd_lookup_light(): switch to fdget^W^Waway from fget_light
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 9c225f2 commit 00e188e

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎net/socket.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -450,16 +450,17 @@ EXPORT_SYMBOL(sockfd_lookup);
450450

451451
static struct socket *sockfd_lookup_light(int fd, int *err, int *fput_needed)
452452
{
453-
struct file *file;
453+
struct fd f = fdget(fd);
454454
struct socket *sock;
455455

456456
*err = -EBADF;
457-
file = fget_light(fd, fput_needed);
458-
if (file) {
459-
sock = sock_from_file(file, err);
460-
if (sock)
457+
if (f.file) {
458+
sock = sock_from_file(f.file, err);
459+
if (likely(sock)) {
460+
*fput_needed = f.flags;
461461
return sock;
462-
fput_light(file, *fput_needed);
462+
}
463+
fdput(f);
463464
}
464465
return NULL;
465466
}

0 commit comments

Comments
 (0)