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;
/* Get the "struct file *" for the eventpoll file */
error = -EBADF;
- file = fget(epfd);
+ file = fget_light(epfd, &fput_needed);
if (!file)
goto error_return;
error = ep_poll(ep, events, maxevents, timeout);
error_fput:
- fput(file);
+ fput_light(file, fput_needed);
error_return:
return error;