提交 5e196a9c 编写于 作者: A Al Viro

switch epoll_wait(2) to fget_light()

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 ecd18815
......@@ -1809,7 +1809,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
int, maxevents, int, timeout)
{
int error;
int error, fput_needed;
struct file *file;
struct eventpoll *ep;
......@@ -1825,7 +1825,7 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
/* Get the "struct file *" for the eventpoll file */
error = -EBADF;
file = fget(epfd);
file = fget_light(epfd, &fput_needed);
if (!file)
goto error_return;
......@@ -1847,7 +1847,7 @@ SYSCALL_DEFINE4(epoll_wait, int, epfd, struct epoll_event __user *, events,
error = ep_poll(ep, events, maxevents, timeout);
error_fput:
fput(file);
fput_light(file, fput_needed);
error_return:
return error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册