mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
epoll: clear the tfile_check_list on -ELOOP
An epoll_ctl(,EPOLL_CTL_ADD,,) operation can return '-ELOOP' to prevent circular epoll dependencies from being created. However, in that case we do not properly clear the 'tfile_check_list'. Thus, add a call to clear_tfile_check_list() for the -ELOOP case. Signed-off-by: Jason Baron <[email protected]> Reported-by: Yurij M. Plotnikov <[email protected]> Cc: Nelson Elhage <[email protected]> Cc: Davide Libenzi <[email protected]> Tested-by: Alexandra N. Kossovsky <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
b1c12cbcd0
commit
13d518074a
1 changed files with 3 additions and 1 deletions
|
|
@ -1663,8 +1663,10 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
|
|||
if (op == EPOLL_CTL_ADD) {
|
||||
if (is_file_epoll(tfile)) {
|
||||
error = -ELOOP;
|
||||
if (ep_loop_check(ep, tfile) != 0)
|
||||
if (ep_loop_check(ep, tfile) != 0) {
|
||||
clear_tfile_check_list();
|
||||
goto error_tgt_fput;
|
||||
}
|
||||
} else
|
||||
list_add(&tfile->f_tfile_llink, &tfile_check_list);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue