提交 00e188ef 编写于 作者: A Al Viro

sockfd_lookup_light(): switch to fdget^W^Waway from fget_light

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 9c225f26
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册